From: Daniel Hahler Date: Thu, 23 Apr 2015 17:55:21 +0000 (+0200) Subject: Fix _autoenv_get_file_mtime for zsh 4 (no pipefail option) X-Git-Url: http://www.git.stargrave.org/?p=zsh-autoenv.git;a=commitdiff_plain;h=e6e906e6b935fcf45e1489afffc9756fbdae5979 Fix _autoenv_get_file_mtime for zsh 4 (no pipefail option) --- diff --git a/autoenv.zsh b/autoenv.zsh index 2fb77ce..772b190 100644 --- a/autoenv.zsh +++ b/autoenv.zsh @@ -66,8 +66,14 @@ if ! zmodload -F zsh/stat b:zstat 2>/dev/null; then # terse output instead of format, which is not supported by busybox. # Assume '+mtime' as $1. _autoenv_get_file_mtime() { - setopt localoptions pipefail - stat -t $1 2>/dev/null | cut -f13 -d ' ' || echo 0 + # setopt localoptions pipefail + local stat + stat=$(stat -t $1 2>/dev/null) + if [[ -n $stat ]]; then + echo ${${(s: :)stat}[13]} + else + echo 0 + fi } else _autoenv_get_file_mtime() {