1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2026-01-01 20:11:06 +01:00

unposted: fix calendar stuff

This commit is contained in:
Peter Stephenson 2006-12-01 12:54:20 +00:00
parent 026bf11566
commit ac05bc6e02
4 changed files with 17 additions and 4 deletions

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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