about summary refs log tree commit diff
path: root/sysdeps/posix/tempname.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/tempname.c')
-rw-r--r--sysdeps/posix/tempname.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c
index 5b6134cb24..c3dbf5278b 100644
--- a/sysdeps/posix/tempname.c
+++ b/sysdeps/posix/tempname.c
@@ -68,6 +68,8 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
 	dir = d;
       else if (dir != NULL && direxists (dir))
 	/* nothing */ ;
+      else
+	dir = NULL;
     }
   if (dir != NULL)
     {