Skip to content

Commit 99c599b

Browse files
akinomyogascop
authored andcommitted
fix(_filedir): always set compopt -o filenames to quote special chars
This fixes test_15d in test/t/unit/test_unit_filedir.py.
1 parent b373d00 commit 99c599b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

bash_completion

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,9 +1359,8 @@ _comp_compgen_filedir()
13591359
compopt -o nospace 2>/dev/null
13601360
fi
13611361
done
1362-
else
1363-
compopt -o filenames 2>/dev/null
13641362
fi
1363+
compopt -o filenames 2>/dev/null
13651364
fi
13661365

13671366
# Note: bash < 4.4 has a bug that all the elements are connected with

test/t/unit/test_unit_compgen_filedir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def functions(self, request, bash):
3737
)
3838
assert_bash_exec(
3939
bash,
40-
"_fcd() { local cur=$(_get_cword); unset -v COMPREPLY; _comp_compgen -C _filedir filedir -d; };"
40+
"_fcd() { local cur=$(_get_cword); unset -v COMPREPLY; _comp_compgen -C _filedir filedir -df; };"
4141
"complete -F _fcd fcd",
4242
)
4343

0 commit comments

Comments
 (0)