summaryrefslogtreecommitdiffstats
path: root/bin/sh/jobs.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-03-15 20:29:31 +0000
committerjilles <jilles@FreeBSD.org>2013-03-15 20:29:31 +0000
commitd967c25f5c41bb5547a03c9b1ce042cb778c54cc (patch)
tree84d8e3b2a4fff8196acae606e87e71bcee71109c /bin/sh/jobs.c
parente3bfa0687cf43740ac4bf886a8089374386b1d0d (diff)
downloadFreeBSD-src-d967c25f5c41bb5547a03c9b1ce042cb778c54cc.zip
FreeBSD-src-d967c25f5c41bb5547a03c9b1ce042cb778c54cc.tar.gz
sh: Recognize "--" and explicitly reject options in wait builtin.
If syntactically invalid job identifiers are to be taken as jobs that exited with status 127, this should not apply to options, so that we can add options later if need be.
Diffstat (limited to 'bin/sh/jobs.c')
-rw-r--r--bin/sh/jobs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index 5a2790b..a092884 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -458,14 +458,15 @@ freejob(struct job *jp)
int
-waitcmd(int argc, char **argv)
+waitcmd(int argc __unused, char **argv __unused)
{
struct job *job;
int status, retval;
struct job *jp;
- if (argc > 1) {
- job = getjob(argv[1]);
+ nextopt("");
+ if (*argptr != NULL) {
+ job = getjob(*argptr);
} else {
job = NULL;
}
OpenPOWER on IntegriCloud