Skip to content

Commit d461b61

Browse files
committed
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 590ce57 commit d461b61

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
@@ -1172,9 +1172,8 @@ _comp_compgen_filedir()
11721172
compopt -o nospace 2>/dev/null
11731173
fi
11741174
done
1175-
else
1176-
compopt -o filenames 2>/dev/null
11771175
fi
1176+
compopt -o filenames 2>/dev/null
11781177
fi
11791178

11801179
# 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)