diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2015-07-29 22:36:45 -0700 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2015-07-29 22:36:45 -0700 |
commit | c0a80171ee615b52a15a6fc8efe83c2bb53451d2 (patch) | |
tree | 197ea8c551416628486c70d9fa208f80a603cc09 /Src | |
parent | 6fd8872d58f18fd144840b05412820994740880f (diff) | |
download | zsh-c0a80171ee615b52a15a6fc8efe83c2bb53451d2.tar.gz zsh-c0a80171ee615b52a15a6fc8efe83c2bb53451d2.tar.xz zsh-c0a80171ee615b52a15a6fc8efe83c2bb53451d2.zip |
35953: fix handling of command substitution in math context
Diffstat (limited to 'Src')
-rw-r--r-- | Src/lex.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/lex.c b/Src/lex.c index b0cd96340..70f3d142a 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -1388,7 +1388,7 @@ dquote_parse(char endchar, int sub) { int pct = 0, brct = 0, bct = 0, intick = 0, err = 0; int c; - int math = endchar == ')' || endchar == ']'; + int math = endchar == ')' || endchar == ']' || infor; int zlemath = math && zlemetacs > zlemetall + addedx - inbufct; while (((c = hgetc()) != endchar || bct || @@ -1995,8 +1995,10 @@ skipcomm(void) #else char *new_tokstr; int new_lexstop, new_lex_add_raw; + int save_infor = infor; struct lexbufstate new_lexbuf; + infor = 0; cmdpush(CS_CMDSUBST); SETPARBEGIN add(Inpar); @@ -2065,6 +2067,7 @@ skipcomm(void) * the recursive parsing. */ lexflags &= ~LEXFLAGS_ZLE; + dbparens = 0; /* restored by zcontext_restore_partial() */ if (!parse_event(OUTPAR) || tok != OUTPAR) lexstop = 1; @@ -2111,6 +2114,7 @@ skipcomm(void) if (!lexstop) SETPAREND cmdpop(); + infor = save_infor; return lexstop; #endif |