diff --git a/CHANGES b/CHANGES index d0e70c68..947511e1 100644 --- a/CHANGES +++ b/CHANGES @@ -17,6 +17,7 @@ bash-completion (2.x) [ Freddy Vulto ] * Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095) * Speed up `compopt' availability detection + * Fix _filedir `-o filenames' detection on bash-3 (Alioth: #312646) [ Anton Khirnov ] * Improve mplayer and mencoder completions. diff --git a/bash_completion b/bash_completion index cd717c52..8661d402 100644 --- a/bash_completion +++ b/bash_completion @@ -647,7 +647,8 @@ _filedir() # Is `-o filenames' set? [[ ( ${COMP_WORDS[0]} && - "$(complete -p ${COMP_WORDS[0]})" == *"-o filenames"* + "$(complete -p ${COMP_WORDS[0]} &>/dev/null)" == \ + *"-o filenames"* ) ]] || { # No, `-o filenames' isn't set; # Emulate `-o filenames' diff --git a/test/lib/completions/sudo.exp b/test/lib/completions/sudo.exp index e7a39162..1afd9933 100644 --- a/test/lib/completions/sudo.exp +++ b/test/lib/completions/sudo.exp @@ -17,4 +17,10 @@ assert_complete "fixtures/shared/default/foo.d/" "sudo cd fixtures/shared/defaul sync_after_int +assert_complete "fixtures/" "sudo sh fix" + + +sync_after_int + + teardown