Skip to content

Commit a880535

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 ed7d46e commit a880535

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
@@ -1252,9 +1252,8 @@ _comp_compgen_filedir()
12521252
compopt -o nospace 2>/dev/null
12531253
fi
12541254
done
1255-
else
1256-
compopt -o filenames 2>/dev/null
12571255
fi
1256+
compopt -o filenames 2>/dev/null
12581257
fi
12591258

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