summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2018-02-26 20:03:48 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2018-02-26 20:03:48 +0000
commitba7de6d0d52578d343a56b49083456ebf00dfb26 (patch)
tree3544dca4500520c4da7c4a6b2e832080366b3a81
parent557d1d7259229ee7dd762750f3bfbcd7412c8564 (diff)
downloadzsh-ba7de6d0d52578d343a56b49083456ebf00dfb26.tar.gz
zsh-ba7de6d0d52578d343a56b49083456ebf00dfb26.tar.xz
zsh-ba7de6d0d52578d343a56b49083456ebf00dfb26.zip
users/23169: only expand ~[...] under the same circumstances as other ~forms
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Base/Completer/_expand3
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e543f861f..099f5ce90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2018-02-26  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* users/23169: Completion/Base/Completer/_expand: treat ~[...]
+	the same way is other forms of tilde expansion: only expand
+	if accept-exact is set.
+
 	* 42399: Doc/Zsh/builtins.yo: better description of interaction
 	between echo and dashes.
 
diff --git a/Completion/Base/Completer/_expand b/Completion/Base/Completer/_expand
index a6e30e891..ee3681bad 100644
--- a/Completion/Base/Completer/_expand
+++ b/Completion/Base/Completer/_expand
@@ -43,7 +43,8 @@ zstyle -s ":completion:${curcontext}:" accept-exact tmp ||
 
 if [[ "$tmp" != (yes|true|on|1) ]]; then
   { [[ "$word" = \~(|[-+]) ||
-       ( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ]] && return 1 }
+	   ( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ||
+     $word = \~\[*\]/* ]] && return 1 }
   { [[ ( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -gt 1 ) ||
        ( "$word" = *\$[a-zA-Z0-9_]## && 
          ${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && continue=1 }