about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Completion/Core/_files2
-rw-r--r--Completion/Core/_path_files5
-rw-r--r--Src/Modules/zutil.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/Completion/Core/_files b/Completion/Core/_files
index ee0b46c1b..821d324d8 100644
--- a/Completion/Core/_files
+++ b/Completion/Core/_files
@@ -35,6 +35,8 @@ if zstyle -s ":completion:${curcontext}:directories" file-patterns tmp &&
   elif [[ "$type" != *[/g]* ]]; then
     type="${type}/"
   fi
+else
+  dopts=()
 fi
 if zstyle -s ":completion:${curcontext}:globbed-files" file-patterns tmp &&
    [[ -n "$tmp" ]]; then
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index 96d7ce6d0..07e75052f 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -276,9 +276,9 @@ for prepath in "$prepaths[@]"; do
       if [[ "$sopt" = *[/f]* && ( -o globdots || "$PREFIX" = .* ) ]] &&
 	  zstyle -s ":completion:${curcontext}:paths" special-dirs atmp; then
 	if [[ "$atmp" = (yes|true|1|on) ]]; then
-	  tmp2=( "$tmp2[@]" . .. )
+	  tmp1=( "$tmp1[@]" . .. )
 	elif [[ "$atmp" = .. ]]; then
-	  tmp2=( "$tmp2[@]" .. )
+	  tmp1=( "$tmp1[@]" .. )
         fi
       fi
     fi
@@ -333,7 +333,6 @@ for prepath in "$prepaths[@]"; do
       # if none of the patterns match.
 
       if [[ -z "$tpre$tsuf" && -n "$pre$suf" ]]; then
-        tmp1=( "$tmp2[@]" )
 	pfxsfx=(-S '' "$pfxsfx[@]")
 	break;
       elif [[ "$haspats" = no && -z "$tpre$tsuf" &&
diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c
index 6631fc123..d40b0ae4c 100644
--- a/Src/Modules/zutil.c
+++ b/Src/Modules/zutil.c
@@ -155,7 +155,7 @@ setstypat(Style s, char *pat, Patprog prog, char **vals)
 	    tmp = 2;
 	}
     }
-    p->weight = weight + tmp;
+    p->weight = (weight += tmp);
 
     for (qq = NULL, q = s->pats; q && q->weight >= weight;
 	 qq = q, q = q->next);