Fixes a directory creation problem in Windows in the root directory.

This commit is contained in:
Andrea Mazzoleni 2013-07-31 22:10:11 +02:00
parent a3eecd1eae
commit a8efa5b325
2 changed files with 16 additions and 0 deletions

7
util.c
View file

@ -696,6 +696,13 @@ int mkancestor(const char* file)
return 0;
}
#ifdef _WIN32
if (strlen(dir) == 2 && dir[1] == ':') {
/* it's a drive specification, nothing more to do */
return 0;
}
#endif
/* try creating it */
if (mkdir(dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0) {
/* just created */