aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);