summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Cracauer <cracauer@FreeBSD.org>1999-12-16 12:03:46 +0000
committerMartin Cracauer <cracauer@FreeBSD.org>1999-12-16 12:03:46 +0000
commit2dde9ce37a66e4dd7310db28031816f9dd4397c0 (patch)
tree31b187de81806acea5e3a97e362105cb0c4f9478
parentedad13b0a12c40e65cc2b4d2b5d063391a0bbe87 (diff)
Notes
-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 d734066fb053..3b93bd9b987d 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 */