Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] prevent parameters leaking from various completers

On 25 Dec 2017, at 20:17, Eric Cook <llua@xxxxxxx> wrote:
>-  local desc=
>+  local desc= input

I noticed that this fouls up git completion. The first time i do `git add
whatever<TAB>`, it prints out a bunch of garbage (since this is happening in a
loop and typeset_silent isn't set). Fix attached.

Also, in _cd, we're marking match, mbegin, and mend as integers when they're
actually arrays. I don't think that will hurt anything, but...?


diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index a46da5b3c..bf5c1e702 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -7727,7 +7727,7 @@ for file in ${^fpath}/_git-*~(*~|*.zwc)(-.N); do
-  local desc= input
+  local desc= input=
   integer i=1
   while read input; do
     if (( i == 2 )); then

diff --git a/Completion/Zsh/Command/_cd b/Completion/Zsh/Command/_cd
index 46237e73d..32f53a78b 100644
--- a/Completion/Zsh/Command/_cd
+++ b/Completion/Zsh/Command/_cd
@@ -21,8 +21,8 @@ _cd_options() {
 setopt localoptions nonomatch
-local expl ret=1 curarg
-integer argstart=2 noopts match mbegin mend
+local expl ret=1 curarg match mbegin mend
+integer argstart=2 noopts
 if (( CURRENT > 1 )); then
   # if not in command position, may have options.

Messages sorted by: Reverse Date, Date, Thread, Author