mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Fix CreateAllDirs() (failed for relative fully non-existing path)
This commit is contained in:
parent
45f78bdf40
commit
1b670a293b
@ -327,11 +327,12 @@ bool CreateAllDirs(std::string path)
|
|||||||
tocreate.push_back(basepath);
|
tocreate.push_back(basepath);
|
||||||
pos = basepath.rfind(DIR_DELIM_C);
|
pos = basepath.rfind(DIR_DELIM_C);
|
||||||
if(pos == std::string::npos)
|
if(pos == std::string::npos)
|
||||||
return false;
|
break;
|
||||||
basepath = basepath.substr(0,pos);
|
basepath = basepath.substr(0,pos);
|
||||||
}
|
}
|
||||||
for(int i=tocreate.size()-1;i>=0;i--)
|
for(int i=tocreate.size()-1;i>=0;i--)
|
||||||
CreateDir(tocreate[i]);
|
if(!CreateDir(tocreate[i]))
|
||||||
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user