summaryrefslogtreecommitdiff
path: root/Src/Zle
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/compcore.c3
-rw-r--r--Src/Zle/zle_tricky.c13
2 files changed, 14 insertions, 2 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 2e2749835..b1de6c6cc 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -607,7 +607,7 @@ callcompfunc(char *s, char *fn)
if (rdstr)
compredirect = rdstr;
kset |= CP_REDIRECT;
- } else
+ } else {
switch (linwhat) {
case IN_ENV:
compcontext = (linarr ? "array_value" : "value");
@@ -637,6 +637,7 @@ callcompfunc(char *s, char *fn)
aadd = 1;
}
}
+ }
compcontext = ztrdup(compcontext);
if (compwords)
freearray(compwords);
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 19787f9ff..999b2b7be 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -398,7 +398,18 @@ mod_export char *cmdstr;
/**/
mod_export char *varname;
-/* != 0 if we are in a subscript */
+/*
+ * != 0 if we are in a subscript.
+ * Of course, this being the completion code, you're expected to guess
+ * what the different numbers actually mean, but here's a cheat:
+ * 1: Key of an ordinary array
+ * 2: Key of a hash
+ * 3: Ummm.... this appears to be a special case of 2. After a lot
+ * of uncommented code looking for groups of brackets, we suddenly
+ * decide to set it to 2. The only upshot seems to be that compctl
+ * then doesn't add a matching ']' at the end, so I think it means
+ * there's one there already.
+ */
/**/
mod_export int insubscr;