From 15594d6c08cf0cd76fe5918ff17dd4637bf6394b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 30 Mar 2009 23:53:23 +0300 Subject: [PATCH] Fix local array initialization under bash 3.0. In bash 3.0, "local foo=(bar)" does not appear to initialize foo to an array containing "bar", but to the non-array value "(bar)". --- bash_completion | 7 +++++-- debian/changelog | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index 2e703d5a..50b16dad 100644 --- a/bash_completion +++ b/bash_completion @@ -272,7 +272,8 @@ _filedir() _expand || return 0 - local toks=( ) tmp + local -a toks + local tmp # TODO: I've removed a "[ -n $tmp ] &&" before `echo $tmp', # and everything works again. If this bug @@ -9114,7 +9115,9 @@ _filedir_xspec() xspec=${xspec#*-X } xspec=${xspec%% *} - local toks=( ) tmp + local -a toks + local tmp + toks=( ${toks[@]-} $( compgen -d -- "$(quote_readline "$cur")" | { while read -r tmp; do diff --git a/debian/changelog b/debian/changelog index 90dc92c5..1b22df3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ bash-completion (1:1.x) UNRELEASED; urgency=low * Install yum-arch completion only if yum-arch is installed. * Update list of yum commands and options. * Add yum repolist, --enable/disablerepo, and --disableexcludes completions. + * Fix local array initialization under bash 2.x, prevents "()" occurring in + file and dir name completions. -- David Paleino Wed, 25 Mar 2009 23:18:24 +0100