Skip to content

Commit

Permalink
fix(_filedir): always set compopt -o filenames to quote special chars
Browse files Browse the repository at this point in the history
This fixes test_15d in test/t/unit/test_unit_filedir.py.
  • Loading branch information
akinomyoga committed May 13, 2024
1 parent f551092 commit 925defb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -1170,9 +1170,8 @@ _comp_compgen_filedir()
compopt -o nospace 2>/dev/null
fi
done
else
compopt -o filenames 2>/dev/null
fi
compopt -o filenames 2>/dev/null
fi

# Note: bash < 4.4 has a bug that all the elements are connected with
Expand Down
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_filedir.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def functions(self, request, bash):
)
assert_bash_exec(
bash,
"_fcd() { local cur=$(_get_cword); unset -v COMPREPLY; _comp_compgen -C _filedir filedir -d; };"
"_fcd() { local cur=$(_get_cword); unset -v COMPREPLY; _comp_compgen -C _filedir filedir -df; };"
"complete -F _fcd fcd",
)

Expand Down

0 comments on commit 925defb

Please sign in to comment.