from oksh: “for var in; do” shouldn’t be interpreted as “for var; do” (POSIX)
This commit is contained in:
9
syn.c
9
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 $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009,
|
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009,
|
||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.91 2013/05/02 21:59:53 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.92 2013/06/03 22:28:17 tg Exp $");
|
||||||
|
|
||||||
struct nesting_state {
|
struct nesting_state {
|
||||||
int start_token; /* token than began nesting (eg, FOR) */
|
int start_token; /* token than began nesting (eg, FOR) */
|
||||||
@ -742,14 +742,9 @@ wordlist(void)
|
|||||||
XPput(args, yylval.cp);
|
XPput(args, yylval.cp);
|
||||||
if (c != '\n' && c != ';')
|
if (c != '\n' && c != ';')
|
||||||
syntaxerr(NULL);
|
syntaxerr(NULL);
|
||||||
if (XPsize(args) == 0) {
|
|
||||||
XPfree(args);
|
|
||||||
return (NULL);
|
|
||||||
} else {
|
|
||||||
XPput(args, NULL);
|
XPput(args, NULL);
|
||||||
return ((char **)XPclose(args));
|
return ((char **)XPclose(args));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* supporting functions
|
* supporting functions
|
||||||
|
Reference in New Issue
Block a user