about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorStephane Chazelas <stephane@chazelas.org>2023-06-02 16:09:53 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2023-06-06 09:22:18 +0100
commit0577dafcaa9d5f7cdbf5637b2dea5ed71dd5af81 (patch)
tree3a0d5928ee437d4e210e9224aec347baaa8c04bf /Completion
parent78102120b9c9e7485e7f537864fc2c24fbe0071a (diff)
downloadzsh-0577dafcaa9d5f7cdbf5637b2dea5ed71dd5af81.tar.gz
zsh-0577dafcaa9d5f7cdbf5637b2dea5ed71dd5af81.tar.xz
zsh-0577dafcaa9d5f7cdbf5637b2dea5ed71dd5af81.zip
Protect some :s from history modifier expansion
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_ant4
-rw-r--r--Completion/Unix/Command/_ant.rej13
-rw-r--r--Completion/Unix/Command/_ffmpeg2
-rw-r--r--Completion/Unix/Command/_java4
-rw-r--r--Completion/Unix/Command/_subversion4
-rw-r--r--Completion/Zsh/Command/_cd2
6 files changed, 21 insertions, 8 deletions
diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant
index 7401c7449..36c7c0e89 100644
--- a/Completion/Unix/Command/_ant
+++ b/Completion/Unix/Command/_ant
@@ -79,8 +79,8 @@ case $state in
     compset -P '*:'
     compset -S ':*'
     _alternative \
-      "classpath:$state:_path_files -qS: -g '*.(jar|zip)(-.)'" \
-      "classpath:$state:_path_files -r': ' -/" && ret=0
+      "classpath:${state}:_path_files -qS: -g '*.(jar|zip)(-.)'" \
+      "classpath:${state}:_path_files -r': ' -/" && ret=0
   ;;
   property)
     if compset -P 1 '*='; then
diff --git a/Completion/Unix/Command/_ant.rej b/Completion/Unix/Command/_ant.rej
new file mode 100644
index 000000000..15e26c9da
--- /dev/null
+++ b/Completion/Unix/Command/_ant.rej
@@ -0,0 +1,13 @@
+--- Completion/Unix/Command/_ant
++++ Completion/Unix/Command/_ant
+@@ -79,8 +79,8 @@ case $state in
+     compset -P '*:'
+     compset -S ':*'
+     _alternative \
+-      "classpath:$state:_path_files -qS: -g '*.(jar|zip)(-.)'" \
+-      "classpath:$state:_path_files -r': ' -/" && ret=0
++      "classpath:${state}:_path_files -qS: -g '*.(jar|zip)(-.)'" \
++      "classpath:${state}:_path_files -r': ' -/" && ret=0
+   ;;
+   property)
+     if compset -P 1 '*='; then
diff --git a/Completion/Unix/Command/_ffmpeg b/Completion/Unix/Command/_ffmpeg
index 1329939cd..e5afdac4f 100644
--- a/Completion/Unix/Command/_ffmpeg
+++ b/Completion/Unix/Command/_ffmpeg
@@ -125,7 +125,7 @@ local -a _ffmpeg_argspecs
                 lastopt_description=${lastopt_description//:/\\:}
                 if [[ $example == filename ]]; then
                     lastopt_takesargs=0
-                    lastopt+=":$lastopt_description:_files"
+                    lastopt+=":${lastopt_description}:_files"
                 elif [[ $lastopt == -[asv]pre ]]; then
                     lastopt_takesargs=0
                     lastopt="*$lastopt"
diff --git a/Completion/Unix/Command/_java b/Completion/Unix/Command/_java
index ff6e82645..b2352df7b 100644
--- a/Completion/Unix/Command/_java
+++ b/Completion/Unix/Command/_java
@@ -438,8 +438,8 @@ classpath|sourcepath|bootstrapclasspath|docletpath)
   compset -P '*:'
   compset -S ':*'
   _alternative \
-    "classpath:$state:_path_files -qS: -g '*.(jar|zip)(-.)'" \
-    "classpath:$state:_path_files -r': ' -/" && return
+    "classpath:${state}:_path_files -qS: -g '*.(jar|zip)(-.)'" \
+    "classpath:${state}:_path_files -r': ' -/" && return
   ;;
 
 extdirs)
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 9a0328dca..ccaf310fa 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -139,7 +139,7 @@ _svn () {
           ;;
           (commit)
             args=(
-	      ${args/(#b)(*--file*):arg:/$match[1]:file:_files}
+	      ${args/(#b)(*--file*):arg:/${match[1]}:file:_files}
               '*:file: _svn_modified "committable"'
             )
           ;;
@@ -189,7 +189,7 @@ _svn () {
 	    args=(
 	    ':propname:(svn:ignore svn:keywords svn:executable svn:eol-style svn:mime-type svn:externals svn:needs-lock svn:global-ignores svn:auto-props)'
 	    ':propval:->propset_propval'
-	    ${args/(#b)(*--file*):arg:/$match[1]:file:_files}
+	    ${args/(#b)(*--file*):arg:/${match[1]}:file:_files}
 	    '*:path or url: _alternative "files:file:_files" "urls:URL:_svn_urls"'
 	    )
 	  ;;
diff --git a/Completion/Zsh/Command/_cd b/Completion/Zsh/Command/_cd
index 961d121e0..9ca846c8f 100644
--- a/Completion/Zsh/Command/_cd
+++ b/Completion/Zsh/Command/_cd
@@ -73,7 +73,7 @@ else
     if zstyle -t ":completion:${curcontext}:path-directories" separate-sections; then
       local elem
       for ((elem=1; elem <= $#tmpcdpath; elem++)); do
-        alt+=( "path-directories-$elem:directory in $tmpcdpath[$elem]:_path_files -W 'tmpcdpath[$elem]' -/" )
+        alt+=( "path-directories-${elem}:directory in ${tmpcdpath[$elem]}:_path_files -W 'tmpcdpath[$elem]' -/" )
       done
     else
       (( $#tmpcdpath )) &&