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:
parent
e3bfa0687c
commit
d967c25f5c
@ -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;
|
||||
}
|
||||
|
3
tools/regression/bin/sh/builtins/wait6.0
Normal file
3
tools/regression/bin/sh/builtins/wait6.0
Normal file
@ -0,0 +1,3 @@
|
||||
# $FreeBSD$
|
||||
|
||||
wait --
|
4
tools/regression/bin/sh/builtins/wait7.0
Normal file
4
tools/regression/bin/sh/builtins/wait7.0
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
: &
|
||||
wait -- $!
|
Loading…
x
Reference in New Issue
Block a user