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/compinit | |
parent | 017738cd60743b21832e5ee66b849b5adea1a28d (diff) | |
download | zsh-b727b74fe23c532050b959fe4ce0382c7213af6b.tar.gz zsh-b727b74fe23c532050b959fe4ce0382c7213af6b.tar.xz 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/compinit')
-rw-r--r-- | Completion/compinit | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Completion/compinit b/Completion/compinit index 5cb527fac..51e9d88b8 100644 --- a/Completion/compinit +++ b/Completion/compinit @@ -301,7 +301,7 @@ compdef() { if [[ -z "$eval" ]] && [[ "$1" = *\=* ]]; then while (( $# )); do if [[ "$1" = *\=* ]]; then - cmd="${1%%\=*}" + cmd="${(q)${1%%\=*}}" svc="${1#*\=}" func="$_comps[${_services[(r)$svc]:-$svc}]" [[ -n ${_services[$svc]} ]] && @@ -412,7 +412,7 @@ compdef() { svc= fi if [[ -z "$new" || -z "${_comps[$1]}" ]]; then - _comps[$cmd]="$func" + _comps[$cmd]="${(q)func}" [[ -n "$svc" ]] && _services[$cmd]="${1#*\=}" fi ;; |