bump simplecpp
This commit is contained in:
parent
fee2f46efe
commit
161bb50e0c
|
@ -1203,9 +1203,15 @@ std::string simplifyPath(std::string path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove "xyz/../"
|
// remove "xyz/../"
|
||||||
while ((pos = path.find("/../")) != std::string::npos) {
|
pos = 1U;
|
||||||
|
while ((pos = path.find("/../", pos)) != std::string::npos) {
|
||||||
const std::string::size_type pos1 = path.rfind("/", pos - 1U);
|
const std::string::size_type pos1 = path.rfind("/", pos - 1U);
|
||||||
|
if (pos1 == std::string::npos)
|
||||||
|
pos++;
|
||||||
|
else {
|
||||||
path.erase(pos1,pos-pos1+3);
|
path.erase(pos1,pos-pos1+3);
|
||||||
|
pos = std::min((std::string::size_type)1, pos1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
|
|
Loading…
Reference in New Issue