diff --git a/bash_completion b/bash_completion index 2a0124a5..410ecef0 100644 --- a/bash_completion +++ b/bash_completion @@ -642,12 +642,12 @@ _filedir() xspec=${1:+"!*.@($1|${1^^})"} || \ xspec=${1:+"!*.@($1|$(printf %s $1 | tr '[:lower:]' '[:upper:]'))"} toks=( ${toks[@]-} $( compgen -f -X "$xspec" -- $quoted) ) - if [ ${#toks[@]} -ne 0 ]; then - # Turn on -o filenames; see http://bugs.debian.org/272660#64 for - # info about the compgen hack (bash < 4) - compopt -o filenames 2>/dev/null || \ - compgen -f /non-existing-dir/ >/dev/null - fi + fi + if [ ${#toks[@]} -ne 0 ]; then + # Turn on -o filenames; see http://bugs.debian.org/272660#64 for info + # about the compgen hack (bash < 4) + compopt -o filenames 2>/dev/null || \ + compgen -f /non-existing-dir/ >/dev/null fi COMPREPLY=( "${COMPREPLY[@]}" "${toks[@]}" )