From 2367f63ee23877b99418a962459bd6fea84e47e5 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 14 Jan 2000 09:14:18 +0000 Subject: zsh-workers/9316 --- Completion/User/_cvs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Completion/User/_cvs b/Completion/User/_cvs index 908c607b0..d460463a3 100644 --- a/Completion/User/_cvs +++ b/Completion/User/_cvs @@ -388,6 +388,15 @@ _cvs_watchers () { '*:file:_cvs_files' } +(( $+functions[_cvs_loadstat] )) || +_cvs_loadstat () { + zstyle -t ":completion${curcontext}:cvs" disable-stat && return + (( $+_cvs_loadstat_tried )) && return + _cvs_loadstat_tried=yes + + zmodload -i zsh/stat 2>/dev/null +} + (( $+functions[_cvs_root] )) || _cvs_root () { local cvspassfile id @@ -395,7 +404,8 @@ _cvs_root () { typeset -gU _cvs_roots if [[ -f "${cvspassfile::=${CVS_PASSFILE:-$HOME/.cvspass}}" ]]; then - if zmodload -e stat; then + _cvs_loadstat + if (( $+builtins[stat] )); then id="$(LANG=C builtin stat -g +mtime -F '%Y/%m/%d-%T' "$cvspassfile")" else id="$(LANG=C ls -l "$cvspassfile")" @@ -508,8 +518,8 @@ _cvs_extract_file_entries () { (( $+functions[_cvs_extract_modifiedfile_entries] )) || _cvs_extract_modifiedfile_entries () { - if zstyle -t ":completion${curcontext}:cvs" disable-stat || - ! { zmodload -e zsh/stat || zmodload zsh/stat }; then + _cvs_loadstat + if (( ! $+builtins[stat] )); then _cvs_extract_file_entries return fi -- cgit 1.4.1