sh: Fix crash when parsing '{ } &'.
MFC after: 1 week
This commit is contained in:
parent
2c090c7168
commit
31d396587e
@ -240,9 +240,9 @@ list(int nlflag, int erflag)
|
||||
n2 = andor();
|
||||
tok = readtoken();
|
||||
if (tok == TBACKGND) {
|
||||
if (n2->type == NPIPE) {
|
||||
if (n2 != NULL && n2->type == NPIPE) {
|
||||
n2->npipe.backgnd = 1;
|
||||
} else if (n2->type == NREDIR) {
|
||||
} else if (n2 != NULL && n2->type == NREDIR) {
|
||||
n2->type = NBACKGND;
|
||||
} else {
|
||||
n3 = (union node *)stalloc(sizeof (struct nredir));
|
||||
|
7
tools/regression/bin/sh/parser/empty-braces1.0
Normal file
7
tools/regression/bin/sh/parser/empty-braces1.0
Normal file
@ -0,0 +1,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
# Unfortunately, some scripts depend on the extension of allowing an empty
|
||||
# pair of braces.
|
||||
|
||||
{ } &
|
||||
wait $!
|
Loading…
x
Reference in New Issue
Block a user