From 768bbc7858202cb28ff97b155bfd24e568b44f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 23 Oct 2010 14:17:49 +0300 Subject: [PATCH] Turn on -o filenames automatically also with _filedir -d. --- bash_completion | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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[@]}" )