diff options
author | jilles <jilles@FreeBSD.org> | 2013-03-15 20:29:31 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-03-15 20:29:31 +0000 |
commit | d967c25f5c41bb5547a03c9b1ce042cb778c54cc (patch) | |
tree | 84d8e3b2a4fff8196acae606e87e71bcee71109c /bin/sh/jobs.c | |
parent | e3bfa0687cf43740ac4bf886a8089374386b1d0d (diff) | |
download | FreeBSD-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.c | 7 |
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; } |