Browse Source

ENH: wow. On some Windows machine, trying to mkdir("C:") would fail miserably. WHy not in debug mode? Why not on other win32 machines. Who knows.

Sebastien Barre 17 years ago
parent
commit
bcad447ce2
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Utilities/cmtar/util.c

+ 7 - 0
Utilities/cmtar/util.c

@@ -110,6 +110,13 @@ mkdirhier(char *path)
     if (dst[0] != '\0')
       strcat(dst, "/");
     strcat(dst, dirp);
+
+#if defined(_WIN32)
+    /* On some Windows machine, trying to mkdir("C:") would fail miserably */
+    if (dst[strlen(dst) - 1] == ':')
+      continue;
+#endif
+
     if (
 #if defined(_WIN32) && !defined(__CYGWIN__)
       mkdir(dst) == -1