about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Command/_libvirt4
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