summary refs log tree commit diff
path: root/Functions/Calendar
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-12-01 12:54:20 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-12-01 12:54:20 +0000
commitac05bc6e026aebc0fa40ec942501026ebd489919 (patch)
tree2c7518a73f6cee8f09f62c6a4e7a06ac8128bb92 /Functions/Calendar
parent026bf115664dd8b0d2c192351355de4458d63039 (diff)
downloadzsh-ac05bc6e026aebc0fa40ec942501026ebd489919.tar.gz
zsh-ac05bc6e026aebc0fa40ec942501026ebd489919.tar.xz
zsh-ac05bc6e026aebc0fa40ec942501026ebd489919.zip
unposted: fix calendar stuff
Diffstat (limited to 'Functions/Calendar')
-rw-r--r--Functions/Calendar/age9
1 files changed, 7 insertions, 2 deletions
diff --git a/Functions/Calendar/age b/Functions/Calendar/age
index 4ed3bd8c2..2d193f473 100644
--- a/Functions/Calendar/age
+++ b/Functions/Calendar/age
@@ -6,13 +6,13 @@
 #
 # Match all files modified between the start of those dates.
 #
-#   print *(e:age 2006/10/04)
+#   print *(e:age 2006/10/04:)
 #
 # Match all files modified on that date.  If the second argument is
 # omitted it is taken to be exactly 24 hours after the first argument
 # (even if the first argument contains a time).
 #
-#   print *(e:age 2006/10/04:10:15 2006/10/04:10:45)
+#   print *(e-age 2006/10/04:10:15 2006/10/04:10:45-)
 #
 # Supply times.  All the time and formats handled by calendar_scandate
 # are allowed, but whitespace must be quoted to ensure age receives
@@ -32,6 +32,8 @@ integer mystat disable_stat
 zmodload -i zsh/stat
 # Allow the builtin stat to be hidden.
 zmodload -i zsh/parameter
+
+{
 if [[ $builtins[stat] != defined ]]; then
   (( disable_stat = 1 ))
   enable stat
@@ -63,11 +65,14 @@ if calendar_scandate $AGEREF; then
   fi
 
   (( date1 <= mtime && mtime <= date2 ))
+  mystat=$?
 else
   mystat=1
 fi
 
+} always {
 # If the builtin stat was previously disabled, disable it again.
 (( disable_stat )) && disable stat
+}
 
 return $mystat