diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2010-12-06 10:49:51 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2010-12-06 10:49:51 +0000 |
commit | 3e97b749f4ccee5bbfb1da1441b4b2cbe7eb2328 (patch) | |
tree | 17a85452f03bb459698c76e9fcdbd253067c6741 /Src/Zle | |
parent | dacb22ecbf493c1f5b386aade94173d2637110c7 (diff) | |
download | zsh-3e97b749f4ccee5bbfb1da1441b4b2cbe7eb2328.tar.gz zsh-3e97b749f4ccee5bbfb1da1441b4b2cbe7eb2328.tar.xz zsh-3e97b749f4ccee5bbfb1da1441b4b2cbe7eb2328.zip |
28486: $compstate[parameter] needs untokenizing
Diffstat (limited to 'Src/Zle')
-rw-r--r-- | Src/Zle/compcore.c | 11 |
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); |