diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-09-06 01:59:22 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-09-06 14:54:05 +0000 |
commit | 9a722df3a6643696a54421994c8908459e29a947 (patch) | |
tree | 305a0a99f77019cd50eae25e9a10e53fc6ecec75 | |
parent | 3768fcc28a28b02ae786faa013fc132cad8582fa (diff) | |
download | zsh-9a722df3a6643696a54421994c8908459e29a947.tar.gz zsh-9a722df3a6643696a54421994c8908459e29a947.tar.xz zsh-9a722df3a6643696a54421994c8908459e29a947.zip |
unposted: _libvirt: Escape $words elements to avoid their interpretation as a pattern against $_cache_virsh_cmds.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | Completion/Unix/Command/_libvirt | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index 327781d6b..d10ba8a26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-09-06 Daniel Shahaf <d.s@daniel.shahaf.name> + + * unposted: Completion/Unix/Command/_libvirt: Escape $words + elements to avoid their interpretation as a pattern against + $_cache_virsh_cmds. + 2016-09-06 Marko Myllynen <myllynen@redhat.com> * unposted: Completion/Unix/Command/_libvirt: Fix leakage of diff --git a/Completion/Unix/Command/_libvirt b/Completion/Unix/Command/_libvirt index d68f82d5e..8ddc28102 100644 --- a/Completion/Unix/Command/_libvirt +++ b/Completion/Unix/Command/_libvirt @@ -133,7 +133,7 @@ case $state in fi local cmd word for word in ${words:1}; do - [[ -n "${_cache_virsh_cmds[(r)$word]}" ]] && cmd=$word && break + [[ -n "${_cache_virsh_cmds[(r)${(b)word}]}" ]] && cmd=$word && break done [[ -z $cmd ]] && return 1 local -a values @@ -213,7 +213,7 @@ case $state in virt_admin_cmd_opts) local cmd word for word in ${words:1}; do - [[ -n "${_cache_virt_admin_cmds[(r)$word]}" ]] && cmd=$word && break + [[ -n "${_cache_virt_admin_cmds[(r)${(b)word}]}" ]] && cmd=$word && break done [[ -z $cmd ]] && return 1 if [[ $words[CURRENT-1] == --server ]]; then |