aboutsummaryrefslogtreecommitdiff
path: root/toys/lsb/mktemp.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-03-11 23:05:54 -0500
committerRob Landley <rob@landley.net>2015-03-11 23:05:54 -0500
commit128928f123d7192d07538d6ea6bbda2b1a75fd5b (patch)
treeb3ae103f6f35d0e87fdf07dcad8480d3523287eb /toys/lsb/mktemp.c
parent4216f59cec17699298f5b4043db513e4859bd232 (diff)
downloadtoybox-128928f123d7192d07538d6ea6bbda2b1a75fd5b.tar.gz
Fix mktemp when TMPDIR is set to empty string, reported by Kylie McClain.
Diffstat (limited to 'toys/lsb/mktemp.c')
-rw-r--r--toys/lsb/mktemp.c2
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);