mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Fix infinite loop in rMkpath
This commit is contained in:
parent
e7ae71bd73
commit
9f268065de
1 changed files with 2 additions and 2 deletions
|
@ -70,7 +70,7 @@ bool rMkpath(const std::string &path)
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if ((pos = path.find_first_of('/', start)) == std::string::npos)
|
if ((pos = path.find_first_of("/\\", start)) == std::string::npos)
|
||||||
pos = path.length();
|
pos = path.length();
|
||||||
|
|
||||||
dir = path.substr(0,pos++);
|
dir = path.substr(0,pos++);
|
||||||
|
@ -80,7 +80,7 @@ bool rMkpath(const std::string &path)
|
||||||
if((ret = mkdir(dir.c_str())) && errno != EEXIST){
|
if((ret = mkdir(dir.c_str())) && errno != EEXIST){
|
||||||
return !ret;
|
return !ret;
|
||||||
}
|
}
|
||||||
if (pos == path.length())
|
if (pos >= path.length())
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue