about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-25 12:01:37 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-25 12:01:37 +0000
commit105456d250059c773f7dba9af29e007b568786c4 (patch)
treeefffb6c23a807133d98fab409d5bb5755b2df36c /Completion
parentc99a94e365d43983121f1e9ae6c345eaf13ab55a (diff)
downloadzsh-105456d250059c773f7dba9af29e007b568786c4.tar.gz
zsh-105456d250059c773f7dba9af29e007b568786c4.tar.xz
zsh-105456d250059c773f7dba9af29e007b568786c4.zip
fix for special-dirs when used with -g patterns (11570)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Core/_path_files14
1 files changed, 8 insertions, 6 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index 31dbcea15..bfe370eed 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -142,6 +142,9 @@ fi
 zstyle -s ":completion:${curcontext}:paths" special-dirs sdirs &&
     [[ "$sdirs" = (yes|true|on|1) ]] && sdirs=yes
 
+[[ "$pats" = ((|*[[:blank:]])\*(|[[:blank:]]*)|*\([^[:blank:]]#/[^[:blank:]]#\)*) ]] &&
+    sopt=$sopt/
+
 zstyle -s ":completion:${curcontext}:files" ignore-parents ignpar
 
 # We get the prefix and the suffix from the line and save the whole
@@ -293,9 +296,9 @@ for prepath in "$prepaths[@]"; do
       fi
       if [[ -n "$sdirs" && ( -o globdots || "$PREFIX" = .* ) ]]; then
 	if [[ "$sdirs" = yes ]]; then
-	  tmp1=( "$tmp1[@]" . .. )
+	  tmp1=( "$tmp1[@]" $^tmp2${skipped}{.,..} )
 	elif [[ "$sdirs" = .. ]]; then
-	  tmp1=( "$tmp1[@]" .. )
+	  tmp1=( "$tmp1[@]" $^tmp2${skipped}.. )
         fi
       fi
     else
@@ -304,13 +307,12 @@ for prepath in "$prepaths[@]"; do
       else
         tmp1=( ${^tmp1}${skipped}${^~pats} )
       fi
-      if [[ -n "$sdirs" &&
-            ( "$sopt" = *[/f]* || "$pats" = *\([^[:blank:]]#/[^[:blank:]]#\)* ) &&
+      if [[ -n "$sdirs" && "$sopt" = *[/f]* &&
             ( -o globdots || "$PREFIX" = .* ) ]]; then
 	if [[ "$sdirs" = yes ]]; then
-	  tmp1=( "$tmp1[@]" . .. )
+	  tmp1=( "$tmp1[@]" $^tmp2${skipped}{.,..} )
 	elif [[ "$sdirs" = .. ]]; then
-	  tmp1=( "$tmp1[@]" .. )
+	  tmp1=( "$tmp1[@]" $^tmp2${skipped}.. )
         fi
       fi
     fi