diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/Zle/compcore.c | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 76b619450..878258130 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2010-12-06 Peter Stephenson <pws@csr.com> + * 28486: Src/Zle/compcore.c: $compstate[parameter] needed + untokenizing. + * Mikael: 28484: Completion/Unix/Command/_du: updated for GNU variant. @@ -13903,5 +13906,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5141 $ +* $Revision: 1.5142 $ ***************************************************** 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); |