From: Perttu Ahola Date: Sun, 11 Mar 2012 14:06:32 +0000 (+0200) Subject: Fix CreateAllDirs() (failed for relative fully non-existing path) X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=1b670a293b2747eccd743b09fda20fbdfc1c1ad7;p=zefram%2Fminetest%2Fminetest_engine.git Fix CreateAllDirs() (failed for relative fully non-existing path) --- diff --git a/src/filesys.cpp b/src/filesys.cpp index a65515d0..1070b31e 100644 --- a/src/filesys.cpp +++ b/src/filesys.cpp @@ -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; }