From 4bed2cf256cf79f8e17093d54a67f75dfa54794a Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sun, 27 Sep 2015 23:56:38 -0700 Subject: 36669: fix ${(z)...} of an an incomplete math expression by restoring "((" at the front of the token --- Src/lex.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Src') diff --git a/Src/lex.c b/Src/lex.c index 70f3d142a..89af96123 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -783,6 +783,15 @@ gettok(void) */ tokstr = NULL; return INPAR; + + case CMD_OR_MATH_ERR: + /* + * LEXFLAGS_ACTIVE means we came from bufferwords(), + * so we treat as an incomplete math expression + */ + if (lexflags & LEXFLAGS_ACTIVE) + tokstr = dyncat("((", tokstr ? tokstr : ""); + /* fall through */ default: return LEXERR; -- cgit 1.4.1