about summary refs log tree commit diff
path: root/Functions/Calendar
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-06-02 17:52:10 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-06-02 17:52:10 +0000
commit4a1549e058ac25d7ea9d2821292eeb5a3eefdd55 (patch)
treef0315b44b2878bdf3e583a174324e6d95add4dc2 /Functions/Calendar
parent663fbdf4670a682c4c88e38c8eb695e919179513 (diff)
downloadzsh-4a1549e058ac25d7ea9d2821292eeb5a3eefdd55.tar.gz
zsh-4a1549e058ac25d7ea9d2821292eeb5a3eefdd55.tar.xz
zsh-4a1549e058ac25d7ea9d2821292eeb5a3eefdd55.zip
unposted: more uses of zstat
Diffstat (limited to 'Functions/Calendar')
-rw-r--r--Functions/Calendar/age22
1 files changed, 3 insertions, 19 deletions
diff --git a/Functions/Calendar/age b/Functions/Calendar/age
index b6f648adb..d47f975ad 100644
--- a/Functions/Calendar/age
+++ b/Functions/Calendar/age
@@ -27,24 +27,16 @@
 # any argument is passed in the first format.
 
 emulate -L zsh
-integer mystat disable_stat
 
-zmodload -i zsh/stat
-# Allow the builtin stat to be hidden.
+zmodload -F zsh/stat b:zstat
 zmodload -i zsh/parameter
 
-{
-if [[ $builtins[stat] != defined ]]; then
-  (( disable_stat = 1 ))
-  enable stat
-fi
-
 autoload -U calendar_scandate
 
 local -a vals
 
 [[ -e $REPLY ]] || return 1
-stat -A vals +mtime $REPLY || return 1
+zstat -A vals +mtime $REPLY || return 1
 
 if (( $# >= 1 )); then
   local AGEREF=$1
@@ -72,14 +64,6 @@ if calendar_scandate -t $AGEREF; then
   fi
 
   (( date1 <= mtime && mtime <= date2 ))
-  mystat=$?
 else
-  mystat=1
+  return 1
 fi
-
-} always {
-# If the builtin stat was previously disabled, disable it again.
-(( disable_stat )) && disable stat
-}
-
-return $mystat