[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-453-gc922626

Ville Skyttä ville.skytta at iki.fi
Sun Oct 23 08:14:16 UTC 2011


The following commit has been merged in the master branch:
commit c922626d4b9b78d266c8336c702b4c5e9a0325d4
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Oct 23 11:13:50 2011 +0300

    cpan2dist: Don't hang if no package list files exist.

diff --git a/completions/cpan2dist b/completions/cpan2dist
index 9845a0a..4ec33c0 100644
--- a/completions/cpan2dist
+++ b/completions/cpan2dist
@@ -30,9 +30,8 @@ _cpan2dist()
             [[ -d "$dir" && -r "$dir/02packages.details.txt.gz" ]] && \
                 packagelist="$dir/02packages.details.txt.gz"
         done
-        COMPREPLY=( $( zgrep "^${cur//-/::}" \
-            $packagelist 2>/dev/null \
-            | awk '{print $1}' | sed -e 's/::/-/g' ) )
+        [[ $packagelist ]] && COMPREPLY=( $( zgrep "^${cur//-/::}" \
+            $packagelist 2>/dev/null | awk '{print $1}' | sed -e 's/::/-/g' ) )
     fi
 } &&
 complete -F _cpan2dist -o default cpan2dist

-- 
bash-completion



More information about the Bash-completion-commits mailing list