Skip to content

Commit 1ea433d

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 514212b commit 1ea433d

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
@@ -1318,9 +1318,8 @@ _comp_compgen_filedir()
13181318
compopt -o nospace 2>/dev/null
13191319
fi
13201320
done
1321-
else
1322-
compopt -o filenames 2>/dev/null
13231321
fi
1322+
compopt -o filenames 2>/dev/null
13241323
fi
13251324

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