diff options
author | Mikael Magnusson <mikachu@gmail.com> | 2024-03-18 15:59:43 +0100 |
---|---|---|
committer | Mikael Magnusson <mikachu@gmail.com> | 2024-03-23 22:19:27 +0100 |
commit | b727b74fe23c532050b959fe4ce0382c7213af6b (patch) | |
tree | f81b2873d91cbff109d820904f9f209825680858 /Completion/compdump | |
parent | 017738cd60743b21832e5ee66b849b5adea1a28d (diff) | |
download | zsh-b727b74fe23c532050b959fe4ce0382c7213af6b.tar.gz zsh-b727b74fe23c532050b959fe4ce0382c7213af6b.zip |
52768: Handle completer filenames with funny characters in them
For example, a file called _foo;bar will cause this to happen:
% hello [press tab]zsh: command not found: _foo
zsh: command not found: bar
Diffstat (limited to 'Completion/compdump')
-rw-r--r-- | Completion/compdump | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Completion/compdump b/Completion/compdump index 6daf92f9f..5af5174f1 100644 --- a/Completion/compdump +++ b/Completion/compdump @@ -113,7 +113,7 @@ integer _i=5 print -n autoload -Uz >& $_d_fd while (( $#_d_als )); do if (( ! $+_compautos[$_d_als[1]] )); then - print -n " $_d_als[1]" + print -rn " ${(q-)_d_als[1]}" if (( ! --_i && $#_d_als > 1 )); then _i=5 print -n ' \\\n ' @@ -126,13 +126,13 @@ print >& $_d_fd local _c for _c in "${(ok@)_compautos}"; do - print "autoload -Uz $_compautos[$_c] $_c" >& $_d_fd + print -r "autoload -Uz ${(q-)_compautos[$_c]} $_c" >& $_d_fd done print >& $_d_fd print "typeset -gUa _comp_assocs" >& $_d_fd -print "_comp_assocs=( ${(qq)_comp_assocs} )" >& $_d_fd +print -r "_comp_assocs=( ${(qq)_comp_assocs} )" >& $_d_fd exec {_d_fd}>&- mv -f $_d_file ${_d_file%.$HOST.$$} |