- see if this fixes loading issue on windows
This commit is contained in:
parent
864ef8acec
commit
bf71461d78
|
@ -546,8 +546,36 @@ void trimPathWithStartingSlash(string &path) {
|
|||
}
|
||||
|
||||
void updatePathClimbingParts(string &path) {
|
||||
// Update paths with /./
|
||||
string::size_type pos = path.find("/./");
|
||||
if(pos != string::npos && pos != 0) {
|
||||
string orig = path;
|
||||
path.erase(pos,2);
|
||||
pos--;
|
||||
|
||||
pos = path.find("/./");
|
||||
if(pos != string::npos && pos != 0) {
|
||||
updatePathClimbingParts(path);
|
||||
}
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("CHANGED relative path from [%s] to [%s]\n",orig.c_str(),path.c_str());
|
||||
}
|
||||
pos = path.find("\\.\\");
|
||||
if(pos != string::npos && pos != 0) {
|
||||
string orig = path;
|
||||
path.erase(pos,2);
|
||||
pos--;
|
||||
|
||||
pos = path.find("\\.\\");
|
||||
if(pos != string::npos && pos != 0) {
|
||||
updatePathClimbingParts(path);
|
||||
}
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("CHANGED relative path from [%s] to [%s]\n",orig.c_str(),path.c_str());
|
||||
}
|
||||
|
||||
// Update paths with ..
|
||||
string::size_type pos = path.find("..");
|
||||
pos = path.find("..");
|
||||
if(pos != string::npos && pos != 0) {
|
||||
string orig = path;
|
||||
path.erase(pos,2);
|
||||
|
@ -572,21 +600,6 @@ void updatePathClimbingParts(string &path) {
|
|||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("CHANGED relative path from [%s] to [%s]\n",orig.c_str(),path.c_str());
|
||||
}
|
||||
|
||||
// Update paths with /./
|
||||
pos = path.find("/./");
|
||||
if(pos != string::npos && pos != 0) {
|
||||
string orig = path;
|
||||
path.erase(pos,2);
|
||||
pos--;
|
||||
|
||||
pos = path.find("/./");
|
||||
if(pos != string::npos && pos != 0) {
|
||||
updatePathClimbingParts(path);
|
||||
}
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("CHANGED relative path from [%s] to [%s]\n",orig.c_str(),path.c_str());
|
||||
}
|
||||
|
||||
/*
|
||||
string::size_type pos = path.rfind("..");
|
||||
if(pos != string::npos && pos != 0) {
|
||||
|
|
Loading…
Reference in New Issue