aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-11 16:06:32 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-03-11 16:06:32 +0200
commit1b670a293b2747eccd743b09fda20fbdfc1c1ad7 (patch)
tree61470ae595a0a55718b613b68e1749c4652dccf6 /src
parent45f78bdf40e273de7598f74c66411d5f42a347fa (diff)
downloadminetest-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.cpp5
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;
}