summaryrefslogtreecommitdiff
path: root/Functions/Zftp/zfrglob
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2015-05-05 23:32:59 +0200
committerAxel Beckert <abe@deuxchevaux.org>2015-05-05 23:58:59 +0200
commitdb38e167634b6c2217eec3a5aafc37c46d9e5a8d (patch)
treedaa342d423febbd3a5a7ef97053037677fab004a /Functions/Zftp/zfrglob
parent01eea47617a6e06debdb4330f92ae69f92089fd2 (diff)
parent3c3c8d3d13fd4cf6c03f81ca8dc18a1efd561728 (diff)
downloadzsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.tar.gz
zsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.zip
Merge branch 'upstream' into debian
Diffstat (limited to 'Functions/Zftp/zfrglob')
-rw-r--r--Functions/Zftp/zfrglob15
1 files changed, 8 insertions, 7 deletions
diff --git a/Functions/Zftp/zfrglob b/Functions/Zftp/zfrglob
index 1fb8d761a..677b85f4b 100644
--- a/Functions/Zftp/zfrglob
+++ b/Functions/Zftp/zfrglob
@@ -33,12 +33,12 @@ if [[ $pat != *[][*?]* &&
( -n $zfrglob || $pat != *[(|)#^]* ) ]]; then
return 0
fi
-local tmpf=${TMPPREFIX}zfrglob$$
if [[ $zfrglob != '' ]]; then
- zftp ls "$pat" >$tmpf 2>/dev/null
- eval "$1=(\$(<\$tmpf))"
- rm -f $tmpf
+ () {
+ zftp ls "$pat" >|$1 2>/dev/null
+ eval "$1=(\$(<\$1))"
+ } =(<<<'temporary file')
else
if [[ $ZFTP_SYSTEM = UNIX* && $pat = */* ]]; then
# not the current directory and we know how to handle paths
@@ -49,10 +49,11 @@ else
dir=/
fi
nondir=${pat##*/}
- zftp ls "$dir" 2>/dev/null >$tmpf
- files=($(<$tmpf))
+ () {
+ zftp ls "$dir" 2>/dev/null >|$1
+ files=($(<$1))
+ } =(<<<'temporary file')
files=(${files:t})
- rm -f $tmpf
else
# we just have to do an ls and hope that's right
local fcache_name