diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2013-06-03 18:40:06 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2013-06-03 18:40:06 +0000 |
commit | 5415a8b3d4a7488733968e3d31a586c2457a8564 (patch) | |
tree | 96058a39f52e9d0a6710709c96b07d837de34ac8 /bin/ksh | |
parent | a74084f37a1e5796d5f53876b7067f1897839251 (diff) |
for var in; do ... shouldn't be interpreted as for var; do ...
Fix by returning an empty token list instead of NULL to consumers.
Brings base ksh more in line with POSIX.
Diffstat (limited to 'bin/ksh')
-rw-r--r-- | bin/ksh/syn.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/bin/ksh/syn.c b/bin/ksh/syn.c index 9b7451a318e..2e92489de40 100644 --- a/bin/ksh/syn.c +++ b/bin/ksh/syn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syn.c,v 1.28 2008/07/23 16:34:38 jaredy Exp $ */ +/* $OpenBSD: syn.c,v 1.29 2013/06/03 18:40:05 jca Exp $ */ /* * shell parser (C version) @@ -598,13 +598,8 @@ wordlist(void) XPput(args, yylval.cp); if (c != '\n' && c != ';') syntaxerr((char *) 0); - if (XPsize(args) == 0) { - XPfree(args); - return NULL; - } else { - XPput(args, NULL); - return (char **) XPclose(args); - } + XPput(args, NULL); + return (char **) XPclose(args); } /* |