[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 10b6c0e21469d28a9d3107801fa7380dfa5f6caa
Freddy Vulto
fvulto at gmail.com
Thu Aug 19 20:31:48 UTC 2010
The following commit has been merged in the master branch:
commit b867bcd64fcac0fbfb610b1acc96895a719278c0
Author: Freddy Vulto <fvulto at gmail.com>
Date: Wed Aug 18 23:01:26 2010 +0200
Fix _filedir error message on bash-3
In case of `sudo cmd', _filedir might be triggered for a cmd not having a
complete command, hence `complete -p cmd' could yield an error. (Alioth
diff --git a/CHANGES b/CHANGES
index d0e70c6..947511e 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 cd717c5..8661d40 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 e7a3916..1afd993 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
--
bash-completion
More information about the Bash-completion-commits
mailing list