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.
This commit is contained in:
jilles 2013-03-15 20:29:31 +00:00
parent e3bfa0687c
commit d967c25f5c
3 changed files with 11 additions and 3 deletions

View File

@ -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;
}

View File

@ -0,0 +1,3 @@
# $FreeBSD$
wait --

View File

@ -0,0 +1,4 @@
# $FreeBSD$
: &
wait -- $!