summaryrefslogtreecommitdiff
path: root/Src/lex.c
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-04-23 15:30:22 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-04-23 15:30:22 +0000
commitfc4511ecb7b68916220edd0bbdf67b2b8eac62d0 (patch)
tree608a56abf719c8a1e61263b4aa2a769a782973b1 /Src/lex.c
parentfe4a49488c9c4ad4e5526c2b0d6915b12d811fc8 (diff)
downloadzsh-fc4511ecb7b68916220edd0bbdf67b2b8eac62d0.tar.gz
zsh-fc4511ecb7b68916220edd0bbdf67b2b8eac62d0.zip
Fix subscripting bug with backslash-double-quote.
Diffstat (limited to 'Src/lex.c')
-rw-r--r--Src/lex.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 428e77431..51a8b8cfe 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1305,7 +1305,8 @@ dquote_parse(char endchar, int sub)
c == endchar || c == '`' ||
(endchar == ']' && (c == '[' || c == ']' ||
c == '(' || c == ')' ||
- c == '{' || c == '}')))
+ c == '{' || c == '}' ||
+ (c == '"' && sub))))
add(Bnull);
else {
/* lexstop is implicitly handled here */
@@ -1390,7 +1391,7 @@ dquote_parse(char endchar, int sub)
err = (!brct-- && math);
break;
case '"':
- if (intick || endchar == ']' || (!endchar && !bct))
+ if (intick || ((endchar == ']' || !endchar) && !bct))
break;
if (bct) {
add(Dnull);
@@ -1463,7 +1464,7 @@ parsestrnoerr(char *s)
/**/
mod_export char *
-parse_subscript(char *s)
+parse_subscript(char *s, int sub)
{
int l = strlen(s), err;
char *t;
@@ -1477,7 +1478,7 @@ parse_subscript(char *s)
len = 0;
bptr = tokstr = s;
bsiz = l + 1;
- err = dquote_parse(']', 1);
+ err = dquote_parse(']', sub);
if (err) {
err = *bptr;
*bptr = 0;