summaryrefslogtreecommitdiff
path: root/Src/Zle/zle_tricky.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/zle_tricky.c')
-rw-r--r--Src/Zle/zle_tricky.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 5a9cccb6f..22c381237 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -456,6 +456,7 @@ checkparams(char *p)
static int
cmphaswilds(char *str)
{
+ char *ptr;
if ((*str == Inbrack || *str == Outbrack) && !str[1])
return 0;
@@ -465,6 +466,14 @@ cmphaswilds(char *str)
if (str[0] == '%' && str[1] ==Quest)
str += 2;
+ /*
+ * In ~[foo], the square brackets are not wild cards.
+ * This test matches the master one in filesubstr().
+ */
+ if (*str == Tilde && str[1] == Inbrack &&
+ (ptr = strchr(str+2, Outbrack)))
+ str = ptr + 1;
+
for (; *str;) {
if (*str == String || *str == Qstring) {
/* A parameter expression. */
@@ -2268,7 +2277,7 @@ doexpansion(char *s, int lst, int olst, int explincmd)
int ng = opts[NULLGLOB];
opts[NULLGLOB] = 1;
- globlist(vl, 1);
+ globlist(vl, PREFORK_NO_UNTOK);
opts[NULLGLOB] = ng;
}
if (errflag)