LRN: Be aware of absolute DOS-style paths as well
authorChristian Grothoff <christian@grothoff.org>
Mon, 1 Aug 2011 20:33:26 +0000 (20:33 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 1 Aug 2011 20:33:26 +0000 (20:33 +0000)
src/util/disk.c

index fd8e5a65462c149a59839ff6090a2e059c3b6939..2d76eab1a7b515189df30ab99e4531e9e3b85f17 100644 (file)
@@ -352,7 +352,11 @@ GNUNET_DISK_mktemp (const char *t)
   char *fn;
 
   if ( (t[0] != '/') &&
-       (t[0] != '\\') )
+       (t[0] != '\\') &&
+#if WINDOWS
+       !(t[0] >= 'A' && t[0] <= 'z' && t[0] != 0 && t[1] == ':')
+#endif
+)
     {
       tmpdir = getenv ("TMPDIR");
       tmpdir = tmpdir ? tmpdir : "/tmp";