File sh-script-completion-boo977336.patch of Package bash-completion-doc

This allows to use COMP_FILEDIR_FALLBACK=yes even if
local sub directories exists (boo#977336)

---
 bash_completion |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- bash_completion
+++ bash_completion	2017-07-04 07:50:05.763059501 +0000
@@ -556,11 +556,6 @@ _filedir()
     local -a toks
     local x tmp
 
-    x=$( compgen -d -- "$cur" ) &&
-    while read -r tmp; do
-        toks+=( "$tmp" )
-    done <<< "$x"
-
     if [[ "$1" != -d ]]; then
         local quoted
         _quote_readline_by_ref "$cur" quoted
@@ -581,6 +576,11 @@ _filedir()
             done <<< "$x"
     fi
 
+    x=$( compgen -d -- "$cur" ) &&
+    while read -r tmp; do
+        toks+=( "$tmp" )
+    done <<< "$x"
+
     if [[ ${#toks[@]} -ne 0 ]]; then
         # 2>/dev/null for direct invocation, e.g. in the _filedir unit test
         compopt -o filenames 2>/dev/null
openSUSE Build Service is sponsored by