about summary refs log tree commit diff
path: root/Functions/Misc/zrecompile
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Misc/zrecompile')
-rw-r--r--Functions/Misc/zrecompile21
1 files changed, 13 insertions, 8 deletions
diff --git a/Functions/Misc/zrecompile b/Functions/Misc/zrecompile
index 88d976f5b..c2aa2a4e3 100644
--- a/Functions/Misc/zrecompile
+++ b/Functions/Misc/zrecompile
@@ -53,7 +53,7 @@ else
 fi
 
 if [[ -n $pats ]]; then
-  local end
+  local end num
 
   while (( $# )); do
     end=$argv[(i)--]
@@ -84,13 +84,18 @@ if [[ -n $pats ]]; then
     (( $#files )) || files=( ${zwc%.zwc} )
 
     if [[ -f $zwc ]]; then
-      re=
-      for file in $files; do
-        if [[ $file -nt $zwc ]]; then
-          re=yes
-	  break
-        fi
-      done
+      num=$(zcompile -t $zwc | wc -l)
+      if [[ num-1 -ne $#files ]]; then
+        re=yes
+      else
+        re=
+        for file in $files; do
+          if [[ $file -nt $zwc ]]; then
+            re=yes
+	    break
+          fi
+        done
+      fi
     else
       re=yes
     fi