From cfd34c75ac10e05a9573f6b26d3cb2d08b269f6a Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Wed, 9 Aug 2017 19:57:47 +0100
Subject: 41504: make empty strings work in case patterns with no leading
parenthesis
---
Src/lex.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'Src/lex.c')
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);
--
cgit 1.4.1