summaryrefslogtreecommitdiffstats
path: root/bin/sh/parser.c
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>1999-12-16 12:03:46 +0000
committercracauer <cracauer@FreeBSD.org>1999-12-16 12:03:46 +0000
commita6c2f2ad3ba07fda28138ea19abe8a12158fbb37 (patch)
tree83122a507b0894b1af93f86f964539c2474bf7f6 /bin/sh/parser.c
parente9b545322a9abb651e2eca82d74259e7a1afdea1 (diff)
downloadFreeBSD-src-a6c2f2ad3ba07fda28138ea19abe8a12158fbb37.zip
FreeBSD-src-a6c2f2ad3ba07fda28138ea19abe8a12158fbb37.tar.gz
Second part of 8-bit fixes.
Diffstat (limited to 'bin/sh/parser.c')
-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