gsu_make_tempfile(): Avoid reading an unbound variable. next
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 28 Jul 2016 11:56:05 +0000 (13:56 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 28 Jul 2016 12:14:17 +0000 (14:14 +0200)
commit6ea0c51a0898253c89775727df4f3814c64bc877
tree95712bac268d589662e0f7e9d59454b1982ae4c4
parent32134f1512eab90da01e9cfd9f676bffef27a939
gsu_make_tempfile(): Avoid reading an unbound variable.

If a gsu script

(a) enables the -u option to treat unset variables as
    an error for parameter expansion,
(b) does not set TMPDIR,
(c) calls gsu_make_tempfile(),

gsu_make_tempfile() fails with an "TMPDIR: unbound variable" error.

The code already contains a fallback for this case, so we can use
the :- construct to avoid the error and fall back to /tmp if TMPDIR
is unset or NULL.
common