[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 6934a508efc9e85ce16877beab1b41c3f7d2bfc6

Ville Skyttä ville.skytta at iki.fi
Tue Nov 16 19:12:17 UTC 2010


The following commit has been merged in the master branch:
commit 6934a508efc9e85ce16877beab1b41c3f7d2bfc6
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Nov 16 21:09:23 2010 +0200

    Test for availability of compopt before invoking it in _compopt_o_filenames().
    
    Invoking it there on bash < 4 may cause terminal echo to be turned off for
    some weird reason (RedHat: #653669).

diff --git a/bash_completion b/bash_completion
index 3247278..d9e1b66 100644
--- a/bash_completion
+++ b/bash_completion
@@ -613,7 +613,10 @@ _quote_readline_by_ref()
 # the bash < 4 compgen hack.
 _compopt_o_filenames()
 {
-    compopt -o filenames 2>/dev/null || \
+    # We test for compopt availability first because directly invoking it on
+    # bash < 4 at this point may cause terminal echo to be turned off for some
+    # reason, see https://bugzilla.redhat.com/653669 for more info.
+    type compopt &>/dev/null && compopt -o filenames 2>/dev/null || \
         compgen -f /non-existing-dir/ >/dev/null
 }
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list