about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--Completion/Darwin/Command/_fink1
-rw-r--r--Completion/Darwin/Type/_retrieve_mac_apps7
-rw-r--r--Completion/Debian/Command/_apt14
-rw-r--r--Completion/Debian/Type/_deb_packages17
-rw-r--r--Completion/Redhat/Command/_rpm1
-rw-r--r--Completion/Redhat/Command/_yum23
-rw-r--r--Completion/Unix/Command/_bogofilter1
-rw-r--r--Completion/Unix/Type/_path_commands4
-rw-r--r--Completion/Unix/Type/_perl_modules1
-rw-r--r--Doc/Zsh/compsys.yo1
11 files changed, 52 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index acd225ff6..fbdb631ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-11-02  Clint Adams  <clint@zsh.org>
+
+	* 25988: Completion/Darwin/Command/_fink,
+	Completion/Darwin/Type/_retrieve_mac_apps,
+	Completion/Debian/Command/_apt,
+	Completion/Debian/Type/_deb_packages,
+	Completion/Redhat/Command/_rpm, Completion/Redhat/Command/_yum,
+	Completion/Unix/Command/_bogofilter,
+	Completion/Unix/Type/_path_commands,
+	Completion/Unix/Type/_perl_modules, Doc/Zsh/compsys.yo: declare
+	temporary cache array as local, thanks to problem noticed by
+	Kazuhiro NISHIYAMA.
+
 2008-11-01  Clint Adams  <clint@zsh.org>
 
 	* 25987: Src/Modules/tcp.c: don't ztrdup the buffer returned by
diff --git a/Completion/Darwin/Command/_fink b/Completion/Darwin/Command/_fink
index f0ff6834e..27ca3740c 100644
--- a/Completion/Darwin/Command/_fink
+++ b/Completion/Darwin/Command/_fink
@@ -55,6 +55,7 @@ _fink_get_packages(){
 }
 
 _finkpkgs_caching_policy(){
+  local -a oldp
   oldp=( "$1"(Nmw+1) )
   (( $#oldp )) ||
     [[ /sw/var/cache/apt/pkgcache.bin -nt "$1" ]] ||
diff --git a/Completion/Darwin/Type/_retrieve_mac_apps b/Completion/Darwin/Type/_retrieve_mac_apps
index f435fde26..e9a30e006 100644
--- a/Completion/Darwin/Type/_retrieve_mac_apps
+++ b/Completion/Darwin/Type/_retrieve_mac_apps
@@ -4,9 +4,10 @@
 # Used by _mac_applications and _mac_files_for_application.
 
 _mac_apps_caching_policy () {
-   # Rebuild if cache is more than a day old
-   oldp=( "$1"(Nmw+1) )
-   (( $#oldp ))
+  # Rebuild if cache is more than a day old
+  local -a oldp
+  oldp=( "$1"(Nmw+1) )
+  (( $#oldp ))
 }
 
 
diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt
index c22e42ecb..bdcfcd26a 100644
--- a/Completion/Debian/Command/_apt
+++ b/Completion/Debian/Command/_apt
@@ -571,14 +571,14 @@ _apt_releases () {
   _tags apt-releases && compadd -a _apt_releases
 }
 
- _apt_caching_policy () {
-    # rebuild if cache is more than a week old
-      oldp=( "$1"(mw+1) )
-        (( $#oldp )) && return 0
+_apt_caching_policy () {
+  local -a oldp
 
-          [[ /var/cache/apt/pkgcache.bin -nt "$1" ||
-             /var/lib/dpkg/available -nt "$1" ]]
-          }
+  oldp=( "$1"(mw+1) )
+  (( $#oldp )) && return 0
 
+  [[ /var/cache/apt/pkgcache.bin -nt "$1" ||
+     /var/lib/dpkg/available -nt "$1" ]]
+}
 
 _apt "$@"
diff --git a/Completion/Debian/Type/_deb_packages b/Completion/Debian/Type/_deb_packages
index 8ddf0e959..dea50cfdc 100644
--- a/Completion/Debian/Type/_deb_packages
+++ b/Completion/Debian/Type/_deb_packages
@@ -108,13 +108,14 @@ _deb_packages () {
   _tags packages && compadd "$expl[@]" - "${(@P)cachevar}"
 }
 
- _debs_caching_policy () {
-    # rebuild if cache is more than a week old
-      oldp=( "$1"(mw+1) )
-        (( $#oldp )) && return 0
-
-	  [[ /var/cache/apt/pkgcache.bin -nt "$1" ||
-	     /var/lib/dpkg/available -nt "$1" ]]
-	  }
+_debs_caching_policy () {
+  # rebuild if cache is more than a week old
+  local -a oldp
+  oldp=( "$1"(mw+1) )
+  (( $#oldp )) && return 0
+
+  [[ /var/cache/apt/pkgcache.bin -nt "$1" ||
+     /var/lib/dpkg/available -nt "$1" ]]
+}
 
 _deb_packages "$@"
diff --git a/Completion/Redhat/Command/_rpm b/Completion/Redhat/Command/_rpm
index 140f5313f..184d7b00d 100644
--- a/Completion/Redhat/Command/_rpm
+++ b/Completion/Redhat/Command/_rpm
@@ -314,6 +314,7 @@ fi
 
 _rpms_caching_policy () {
   # rebuild if cache is more than a week old
+  local -a oldp
   oldp=( "$1"(mw+1) )
   (( $#oldp )) && return 0
 
diff --git a/Completion/Redhat/Command/_yum b/Completion/Redhat/Command/_yum
index 8988b43d7..455812b1b 100644
--- a/Completion/Redhat/Command/_yum
+++ b/Completion/Redhat/Command/_yum
@@ -274,21 +274,22 @@ _yum_list_or_info()
 
 _yum_caching_policy() 
 {
-	local _yumrepomds
+  local _yumrepomds
+  local -a oldp
 
-  	# rebuild if cache is more than a week old
-  	oldp=( "$1"(mw+1) )
-  	(( $#oldp )) && return 0
+  # rebuild if cache is more than a week old
+  oldp=( "$1"(mw+1) )
+  (( $#oldp )) && return 0
 
-  	_yumrepomds=( /var/cache/yum/**/repomd.xml )
+  _yumrepomds=( /var/cache/yum/**/repomd.xml )
 
-  	if (( $#_yumrepomds )); then
-    	for repo in $_yumrepomds; do
-      		[[ "$repo" -nt "$1" ]] && return 0
-    	done
-  	fi
+  if (( $#_yumrepomds )); then
+    for repo in $_yumrepomds; do
+      [[ "$repo" -nt "$1" ]] && return 0
+    done
+  fi
 
-  	return 1
+  return 1
 }
 
 _yum "$@"
diff --git a/Completion/Unix/Command/_bogofilter b/Completion/Unix/Command/_bogofilter
index 9e6ac3f88..980d3155e 100644
--- a/Completion/Unix/Command/_bogofilter
+++ b/Completion/Unix/Command/_bogofilter
@@ -3,6 +3,7 @@
 local expl ret bogotokens
 
 _bogoutil_caching_policy () {
+  local -a oldp
 
   # rebuild if cache is more than a week old
   oldp=( "$1"(mw+1) )
diff --git a/Completion/Unix/Type/_path_commands b/Completion/Unix/Type/_path_commands
index 340a013c3..393c0c67e 100644
--- a/Completion/Unix/Type/_path_commands
+++ b/Completion/Unix/Type/_path_commands
@@ -3,8 +3,8 @@
 (( $+functions[_path_commands_caching_policy] )) ||
 _path_commands_caching_policy() {
 
-local oldp file
-typeset -a dbfiles
+local file
+local -a oldp dbfiles
 
 # rebuild if cache is more than a week old
 oldp=( "$1"(Nmw+1) )
diff --git a/Completion/Unix/Type/_perl_modules b/Completion/Unix/Type/_perl_modules
index 00629335b..26cab0c23 100644
--- a/Completion/Unix/Type/_perl_modules
+++ b/Completion/Unix/Type/_perl_modules
@@ -132,6 +132,7 @@ _perl_modules () {
 
 _perl_modules_caching_policy () {
   local _perllocals
+  local -a oldp
 
   # rebuild if cache is more than a week old
   oldp=( "$1"(mw+1) )
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 825c441e3..be78b0aa2 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -3906,6 +3906,7 @@ Example:
 
 example(_example_caching_policy () {
     # rebuild if cache is more than a week old
+    local -a oldp
     oldp=( "$1"(Nmw+1) )
     (( $#oldp ))
 })