check that TMPDIR is set before using it

This commit is contained in:
Kurtis Rader 2017-07-04 13:20:46 -07:00
parent 9fb7037174
commit e4aedcd22c

View file

@ -81,13 +81,10 @@ function mktemp
exit 1
end
switch "$TMPDIR"
case ''
set template /tmp/$template
case '*/'
set template $TMPDIR$template
case '*'
if set -q TMPDIR[1]
set template $TMPDIR/$template
else
set template /tmp/$template
end
end
set args $args $template