diff options
author | Rob Landley <rob@landley.net> | 2015-03-11 23:05:54 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-03-11 23:05:54 -0500 |
commit | 128928f123d7192d07538d6ea6bbda2b1a75fd5b (patch) | |
tree | b3ae103f6f35d0e87fdf07dcad8480d3523287eb /toys/lsb | |
parent | 4216f59cec17699298f5b4043db513e4859bd232 (diff) | |
download | toybox-128928f123d7192d07538d6ea6bbda2b1a75fd5b.tar.gz |
Fix mktemp when TMPDIR is set to empty string, reported by Kylie McClain.
Diffstat (limited to 'toys/lsb')
-rw-r--r-- | toys/lsb/mktemp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/lsb/mktemp.c b/toys/lsb/mktemp.c index cc426656..cee62c1d 100644 --- a/toys/lsb/mktemp.c +++ b/toys/lsb/mktemp.c @@ -38,7 +38,7 @@ void mktemp_main(void) if (!template) template = "tmp.XXXXXX"; if (!TT.tmpdir) TT.tmpdir = getenv("TMPDIR"); - if (!TT.tmpdir) TT.tmpdir = "/tmp"; + if (!TT.tmpdir || !*TT.tmpdir) TT.tmpdir = "/tmp"; template = strchr(template, '/') ? xstrdup(template) : xmprintf("%s/%s", TT.tmpdir, template); |