sh: Partially revert r206146, allowing double-quotes in arithmetic.
These do pretty much nothing (except that parentheses are ignored), but people seem to use them and allowing them does not hurt much. Single-quotes seem not to be used and cause silently different behaviour with ksh93 character constants.
This commit is contained in:
parent
6d2b7c381b
commit
7f728c60bc
@ -232,6 +232,7 @@ main(int argc __unused, char **argv __unused)
|
||||
add("\n", "CNL");
|
||||
add("\\", "CBACK");
|
||||
add("`", "CBQUOTE");
|
||||
add("\"", "CDQUOTE");
|
||||
add("$", "CVAR");
|
||||
add("}", "CENDVAR");
|
||||
add("(", "CLP");
|
||||
|
@ -1223,7 +1223,10 @@ readtoken1(int firstc, char const *initialsyntax, char *eofmark, int striptabs)
|
||||
if (eofmark != NULL && newvarnest == 0)
|
||||
USTPUTC(c, out);
|
||||
else {
|
||||
state[level].syntax = BASESYNTAX;
|
||||
if (state[level].category == TSTATE_ARITH)
|
||||
state[level].syntax = ARISYNTAX;
|
||||
else
|
||||
state[level].syntax = BASESYNTAX;
|
||||
quotef++;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user