summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/sh/parser.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index d734066..3b93bd9 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -868,6 +868,7 @@ readtoken1(firstc, syntax, eofmark, striptabs)
int parenlevel; /* levels of parens in arithmetic */
int oldstyle;
char const *prevsyntax; /* syntax before arithmetic */
+ int synentry;
#if __GNUC__
/* Avoid longjmp clobbering */
(void) &out;
@@ -879,6 +880,7 @@ readtoken1(firstc, syntax, eofmark, striptabs)
(void) &oldstyle;
(void) &prevsyntax;
(void) &syntax;
+ (void) &synentry;
#endif
startlinno = plinno;
@@ -906,7 +908,13 @@ readtoken1(firstc, syntax, eofmark, striptabs)
CHECKEND(); /* set c to PEOF if at end of here document */
for (;;) { /* until end of line or end of word */
CHECKSTRSPACE(3, out); /* permit 3 calls to USTPUTC */
- switch(syntax[c]) {
+
+ if (c < 0 && c != PEOF)
+ synentry = CWORD;
+ else
+ synentry = syntax[c];
+
+ switch(synentry) {
case CNL: /* '\n' */
if (syntax == BASESYNTAX)
goto endword; /* exit outer loop */
OpenPOWER on IntegriCloud