summaryrefslogtreecommitdiff
path: root/Src/lex.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2017-08-09 19:57:47 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-08-09 19:57:47 +0100
commitcfd34c75ac10e05a9573f6b26d3cb2d08b269f6a (patch)
tree0fcf5d73fb8340638e25055c63415b8410ffe670 /Src/lex.c
parent23af20d0b9ecd40e401f44d8615e096e0081b427 (diff)
downloadzsh-cfd34c75ac10e05a9573f6b26d3cb2d08b269f6a.tar.gz
zsh-cfd34c75ac10e05a9573f6b26d3cb2d08b269f6a.zip
41504: make empty strings work in case patterns with no leading parenthesis
Diffstat (limited to 'Src/lex.c')
-rw-r--r--Src/lex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Src/lex.c b/Src/lex.c
index b2d9b3f42..8493d4737 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -760,7 +760,7 @@ gettok(void)
return AMPER;
case LX1_BAR:
d = hgetc();
- if (d == '|')
+ if (d == '|' && !incasepat)
return DBAR;
else if (d == '&')
return BARAMP;
@@ -1058,7 +1058,7 @@ gettokstr(int c, int sub)
if (isset(SHGLOB)) {
if (sub || in_brace_param)
break;
- if (incasepat && !lexbuf.len)
+ if (incasepat > 0 && !lexbuf.len)
return INPAR;
if (!isset(KSHGLOB) && lexbuf.len)
goto brk;
@@ -1859,7 +1859,7 @@ exalias(void)
Reswd rw;
hwend();
- if (interact && isset(SHINSTDIN) && !strin && !incasepat &&
+ if (interact && isset(SHINSTDIN) && !strin && incasepat <= 0 &&
tok == STRING && !nocorrect && !(inbufflags & INP_ALIAS) &&
(isset(CORRECTALL) || (isset(CORRECT) && incmdpos)))
spckword(&tokstr, 1, incmdpos, 1);