diff --git a/HISTORY b/HISTORY index 09fe1a89..3ff89583 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,15 @@ SnapRAID HISTORY ================ +3.2 2013/7 +========== + * Fix a directory creation problem in Windows when the "disk" option points to + the root directory of a drive. Now SnapRAID won't complain about the + inability to create such directory. + If you encouter this problem when trying to recover your data, just upgrade + to this version, and you'll be able to complete the recovering process. + No need to upgrade for platforms different than Windows. + 3.1 2013/5 ========== * Direct use of Windows API for disk access to improve error reporting. diff --git a/util.c b/util.c index 45199493..29210fb8 100644 --- a/util.c +++ b/util.c @@ -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 */