summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--Completion/bashcompinit8
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 758a0cc66..3fc59b25c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-05-04 Barton E. Schaefer <schaefer@zsh.org>
+
+ * 29140: Completion/bashcompinit: introduce function-scope wrapper
+ around the call to the bash completion function; in this wrapper,
+ hide the "words" special variable so that it may be used as an
+ ordinary variable by the bash completions.
+
2011-05-04 Peter Stephenson <pws@csr.com>
* Rocky Bernstein: 29135 (plus tweaks): Completion/bashcompinit,
@@ -14578,5 +14585,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5276 $
+* $Revision: 1.5277 $
*****************************************************
diff --git a/Completion/bashcompinit b/Completion/bashcompinit
index 2ccc94de9..63101a9c8 100644
--- a/Completion/bashcompinit
+++ b/Completion/bashcompinit
@@ -127,7 +127,13 @@ compgen() {
;;
F)
COMPREPLY=()
- $OPTARG "${words[0]}" "${words[CURRENT-1]}" "${words[CURRENT-2]}"
+ (){
+ set -- "${words[0]}" "${words[CURRENT-1]}" "${words[CURRENT-2]}"
+ # There may be more things we need to add to this typeset to
+ # protect bash functions from compsys special variable names
+ typeset -h words
+ $OPTARG "$@"
+ }
results+=( "${COMPREPLY[@]}" )
;;
G)