mirror of https://github.com/dyne/zuper.git
fixes to tmpfile scoping
This commit is contained in:
parent
4b542abc04
commit
cb7517e678
10
zuper
10
zuper
|
|
@ -24,7 +24,7 @@
|
||||||
##########################
|
##########################
|
||||||
typeset -aU vars
|
typeset -aU vars
|
||||||
typeset -aU arrs
|
typeset -aU arrs
|
||||||
vars=(debug quiet)
|
vars=(debug quiet ztmpfile)
|
||||||
arrs=()
|
arrs=()
|
||||||
|
|
||||||
debug=${debug:-0}
|
debug=${debug:-0}
|
||||||
|
|
@ -219,14 +219,16 @@ endgame() {
|
||||||
##########################
|
##########################
|
||||||
# Temp file handling
|
# Temp file handling
|
||||||
|
|
||||||
|
# ztmp() fills in $ztmpfile global. Caller must copy that variable as
|
||||||
|
# it will be overwritten at every call.
|
||||||
ztmp() {
|
ztmp() {
|
||||||
fn ztmp
|
fn ztmp
|
||||||
|
|
||||||
_tmp=`mktemp`
|
ztmpfile=`mktemp`
|
||||||
tmpfiles+=($_tmp)
|
tmpfiles+=($ztmpfile)
|
||||||
print $_tmp
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# All tempfiles are freed in endgame()
|
||||||
_ztmp_destructor() {
|
_ztmp_destructor() {
|
||||||
fn _ztmp_destructor
|
fn _ztmp_destructor
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue