diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2007-01-23 16:07:46 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-01-23 16:07:46 +0000 |
commit | 61a5c826c8472a8d9058ebb93e5fbbc5796cd46d (patch) | |
tree | 152657b3a7de9ab588d3a76623b5d1cc943e3937 /Src/lex.c | |
parent | e4cc61d5c66556c6aad10a4b7ef169a5d210d17e (diff) | |
download | zsh-61a5c826c8472a8d9058ebb93e5fbbc5796cd46d.tar.gz zsh-61a5c826c8472a8d9058ebb93e5fbbc5796cd46d.tar.xz zsh-61a5c826c8472a8d9058ebb93e5fbbc5796cd46d.zip |
23126, modified: bug in zle history inside $( and $((
Diffstat (limited to 'Src/lex.c')
-rw-r--r-- | Src/lex.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/Src/lex.c b/Src/lex.c index 095d58150..7748bedad 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -542,14 +542,14 @@ cmd_or_math(int cs_type) c = dquote_parse(')', 0); cmdpop(); *bptr = '\0'; - if (!c) { - c = hgetc(); - if (c == ')') - return 1; - hungetc(c); - lexstop = 0; - c = ')'; - } + if (c) + return 1; + c = hgetc(); + if (c == ')') + return 1; + hungetc(c); + lexstop = 0; + c = ')'; hungetc(c); lexstop = 0; while (len > oldlen) { @@ -1436,8 +1436,15 @@ dquote_parse(char endchar, int sub) cmdpop(); if (lexstop) err = intick || endchar || err; - else if (err == 1) + else if (err == 1) { + /* + * TODO: as far as I can see, this hack is used in gettokstr() + * to hungetc() a character on an error. However, I don't + * understand what that actually gets us, and we can't guarantee + * it's a character anyway, because of the previous test. + */ err = c; + } if (zlemath && zlemetacs <= zlemetall + 1 - inbufct) inwhat = IN_MATH; return err; |