Fix CreateAllDirs() (failed for relative fully non-existing path)
authorPerttu Ahola <celeron55@gmail.com>
Sun, 11 Mar 2012 14:06:32 +0000 (16:06 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sun, 11 Mar 2012 14:06:32 +0000 (16:06 +0200)
src/filesys.cpp

index a65515d0351dc12f1a6e7236254922a652743cdb..1070b31e593a4f70755cb66c3de3ad21a0936a00 100644 (file)
@@ -327,11 +327,12 @@ bool CreateAllDirs(std::string path)
                tocreate.push_back(basepath);
                pos = basepath.rfind(DIR_DELIM_C);
                if(pos == std::string::npos)
-                       return false;
+                       break;
                basepath = basepath.substr(0,pos);
        }
        for(int i=tocreate.size()-1;i>=0;i--)
-               CreateDir(tocreate[i]);
+               if(!CreateDir(tocreate[i]))
+                       return false;
        return true;
 }