From fdfe1fe72f8fe358d2b64ddc9e1b58dda4d3ba90 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 6 Jun 2015 14:54:33 +1200 Subject: Separate declaration from assignment --- bash/bashrc.d/pass.bash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bash/bashrc.d/pass.bash') diff --git a/bash/bashrc.d/pass.bash b/bash/bashrc.d/pass.bash index e173531f..d40a833f 100644 --- a/bash/bashrc.d/pass.bash +++ b/bash/bashrc.d/pass.bash @@ -8,7 +8,8 @@ fi _pass() { # If we can't read the password directory, just bail - local passdir=${PASSWORD_STORE_DIR:-$HOME/.password-store} + local passdir + passdir=${PASSWORD_STORE_DIR:-$HOME/.password-store} if [[ ! -r $passdir ]] ; then return 1 fi @@ -16,8 +17,8 @@ _pass() # Iterate through list of .gpg paths, extension stripped, null-delimited, # and filter them down to the ones matching the completing word (compgen # doesn't seem to do this properly with a null delimiter) - local word=${COMP_WORDS[COMP_CWORD]} - local entry + local word entry + word=${COMP_WORDS[COMP_CWORD]} while read -d '' -r entry ; do if [[ $entry == "$word"* ]] ; then COMPREPLY=("${COMPREPLY[@]}" "$entry") -- cgit v1.2.3