From 128928f123d7192d07538d6ea6bbda2b1a75fd5b Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 11 Mar 2015 23:05:54 -0500 Subject: Fix mktemp when TMPDIR is set to empty string, reported by Kylie McClain. --- toys/lsb/mktemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.3