diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-11 16:06:32 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-11 16:06:32 +0200 |
commit | 1b670a293b2747eccd743b09fda20fbdfc1c1ad7 (patch) | |
tree | 61470ae595a0a55718b613b68e1749c4652dccf6 /src | |
parent | 45f78bdf40e273de7598f74c66411d5f42a347fa (diff) | |
download | minetest-1b670a293b2747eccd743b09fda20fbdfc1c1ad7.tar.gz minetest-1b670a293b2747eccd743b09fda20fbdfc1c1ad7.tar.bz2 minetest-1b670a293b2747eccd743b09fda20fbdfc1c1ad7.zip |
Fix CreateAllDirs() (failed for relative fully non-existing path)
Diffstat (limited to 'src')
-rw-r--r-- | src/filesys.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/filesys.cpp b/src/filesys.cpp index a65515d03..1070b31e5 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; } |