summaryrefslogtreecommitdiffstats
path: root/bin/sh/parser.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-10-24 22:25:38 +0000
committerjilles <jilles@FreeBSD.org>2010-10-24 22:25:38 +0000
commit51f0756257f4101578920ca0e00c705dd2e1163b (patch)
treeade424f7898169ec8c5b9d51282690b7751e31e9 /bin/sh/parser.c
parent58038d3e9e1f45ea4dccdfeb21e3f9bb40ae4950 (diff)
downloadFreeBSD-src-51f0756257f4101578920ca0e00c705dd2e1163b.zip
FreeBSD-src-51f0756257f4101578920ca0e00c705dd2e1163b.tar.gz
sh: Ignore double-quotes in arithmetic rather than treating them as quotes.
This provides similar behaviour, but allows a simpler parser. This changes r206473. Exp-run done by: pav (with some other sh(1) changes)
Diffstat (limited to 'bin/sh/parser.c')
-rw-r--r--bin/sh/parser.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 4c1b272..9500d91 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -1224,10 +1224,7 @@ readtoken1(int firstc, char const *initialsyntax, char *eofmark, int striptabs)
if (eofmark != NULL && newvarnest == 0)
USTPUTC(c, out);
else {
- if (state[level].category == TSTATE_ARITH)
- state[level].syntax = ARISYNTAX;
- else
- state[level].syntax = BASESYNTAX;
+ state[level].syntax = BASESYNTAX;
quotef++;
}
break;
@@ -1282,6 +1279,8 @@ readtoken1(int firstc, char const *initialsyntax, char *eofmark, int striptabs)
break;
case CEOF:
goto endword; /* exit outer loop */
+ case CIGN:
+ break;
default:
if (level == 0)
goto endword; /* exit outer loop */
OpenPOWER on IntegriCloud