about summary refs log tree commit diff
path: root/Completion/Redhat
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2008-11-02 14:12:29 +0000
committerClint Adams <clint@users.sourceforge.net>2008-11-02 14:12:29 +0000
commit6dbf2f2f4a97e2831094a73c662484ce990e7e41 (patch)
tree2b7eb40ddd7e3518a2a962eb8accf5a1ef7d9616 /Completion/Redhat
parent1b78e1a9121111ccb628262202c112c199ffc6d9 (diff)
downloadzsh-6dbf2f2f4a97e2831094a73c662484ce990e7e41.tar.gz
zsh-6dbf2f2f4a97e2831094a73c662484ce990e7e41.tar.xz
zsh-6dbf2f2f4a97e2831094a73c662484ce990e7e41.zip
25988: declare temporary cache array as local, thanks to problem noticed by Kazuhiro NISHIYAMA.
Diffstat (limited to 'Completion/Redhat')
-rw-r--r--Completion/Redhat/Command/_rpm1
-rw-r--r--Completion/Redhat/Command/_yum23
2 files changed, 13 insertions, 11 deletions
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 "$@"