From 6dbf2f2f4a97e2831094a73c662484ce990e7e41 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sun, 2 Nov 2008 14:12:29 +0000 Subject: 25988: declare temporary cache array as local, thanks to problem noticed by Kazuhiro NISHIYAMA. --- Completion/Debian/Command/_apt | 14 +++++++------- Completion/Debian/Type/_deb_packages | 17 +++++++++-------- 2 files changed, 16 insertions(+), 15 deletions(-) (limited to 'Completion/Debian') 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 "$@" -- cgit 1.4.1