summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/compcore.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index ee44c46ef..415f91f79 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -648,6 +648,17 @@ callcompfunc(char *s, char *fn)
         else
             compredirs = (char **) zshcalloc(sizeof(char *));
 
+	/*
+	 * We need to untokenize compparameter which is the
+	 * raw internals of a parameter subscript.
+	 *
+	 * The double memory duplication is a bit ugly: the additional
+	 * dupstring() is necessary because untokenize() might change
+	 * the string length and so later zsfree() would get the wrong
+	 * length of the string.
+	 */
+	compparameter = dupstring(compparameter);
+	untokenize(compparameter);
 	compparameter = ztrdup(compparameter);
 	compredirect = ztrdup(compredirect);
 	zsfree(compquote);