about summary refs log tree commit diff
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
parent026bf115664dd8b0d2c192351355de4458d63039 (diff)
downloadzsh-ac05bc6e026aebc0fa40ec942501026ebd489919.tar.gz
zsh-ac05bc6e026aebc0fa40ec942501026ebd489919.tar.xz
zsh-ac05bc6e026aebc0fa40ec942501026ebd489919.zip
unposted: fix calendar stuff
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Type/_list_files5
-rw-r--r--Doc/Zsh/calsys.yo2
-rw-r--r--Functions/Calendar/age9
4 files changed, 17 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 085bbfffc..029c4d03c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-12-01  Peter Stephenson  <pws@csr.com>
 
+	* unposted fixes for previous commit:
+	Completion/Unix/Type/_list_files, Doc/Zsh/calsys.yo,
+	Functions/Calendar/age: age was broken; fix typos; use
+	"always" block to restore stat disability.
+
 	* c.f. 23023: Completion/Unix/Type/_list_files, Doc/.distfiles,
 	Doc/Makefile.in, Doc/zsh.yo, Doc/zshcalsys.yo, Doc/Zsh/.distfiles,
 	Doc/Zsh/calsys.yo, Doc/Zsh/compsys.yo, Doc/Zsh/intro.yo,
diff --git a/Completion/Unix/Type/_list_files b/Completion/Unix/Type/_list_files
index 3d5281669..8475d2056 100644
--- a/Completion/Unix/Type/_list_files
+++ b/Completion/Unix/Type/_list_files
@@ -48,6 +48,7 @@ done
 
 zmodload -i zsh/stat 2>/dev/null || return 1
 
+{
 # Enable stat temporarily if disabled to avoid clashes.
 integer disable_stat
 if [[ ${builtins[stat]} != defined ]]; then
@@ -73,5 +74,7 @@ done
 
 (( ${#listfiles} )) && listopts=(-d listfiles -l -o)
 
-(( disable_stat )) && disable stat
+} always {
+  (( disable_stat )) && disable stat
+}
 return 0
diff --git a/Doc/Zsh/calsys.yo b/Doc/Zsh/calsys.yo
index d3b683a01..543bf0935 100644
--- a/Doc/Zsh/calsys.yo
+++ b/Doc/Zsh/calsys.yo
@@ -381,7 +381,7 @@ example(print *+LPAR()e:age 2006/10/04 2006/10/09:+RPAR())
 The example above matches all files modified between the start of those
 dates.
 
-example(print *+LPAR()e:age 2006/10/04+RPAR())
+example(print *+LPAR()e:age 2006/10/04:+RPAR())
 
 The example above matches all files modified on that date.  If the second
 argument is omitted it is taken to be exactly 24 hours after the first
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