diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2008-03-08 01:20:49 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2008-03-08 01:20:49 +0000 |
commit | 25413054c11fc4b67284d4d6db48272182da1d26 (patch) | |
tree | 7a7e7a187e8c505d531e1f5d354f846b24de646a /Src/lex.c | |
parent | db717e3025b54d363d0f25908485370b10c9ec6a (diff) | |
download | zsh-25413054c11fc4b67284d4d6db48272182da1d26.tar.gz zsh-25413054c11fc4b67284d4d6db48272182da1d26.tar.xz zsh-25413054c11fc4b67284d4d6db48272182da1d26.zip |
24699: bug with ${(Q)...} on initial ">"
bug with ${(z)...} on string with unterminated "("
Diffstat (limited to 'Src/lex.c')
-rw-r--r-- | Src/lex.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Src/lex.c b/Src/lex.c index 4128f109a..739a6f391 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -914,6 +914,19 @@ gettok(void) return gettokstr(c, 0); } +/* + * Get the remains of a token string. This has two uses. + * When called from gettok(), with sub = 0, we have already identified + * any interesting initial character and want to get the rest of + * what we now know is a string. However, the string may still include + * metacharacters and potentially substitutions. + * + * When called from parse_subst_string() with sub = 1, we are not + * fully parsing a command line, merely tokenizing a string. + * In this case we always add characters to the parsed string + * unless there is a parse error. + */ + /**/ static int gettokstr(int c, int sub) @@ -1134,7 +1147,10 @@ gettokstr(int c, int sub) if (e != '(') { hungetc(e); lexstop = 0; - goto brk; + if (in_brace_param || sub) + break; + else + goto brk; } add(Outang); if (skipcomm()) { |