mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-27 00:25:38 +00:00
getGenericPath: don't remove trailing '/' when path is '/'.
This prevents 'getAbsolutePath' to get into a loop with an empty path and EmulationStation to crash when the `$CWD` is `/`.
This commit is contained in:
parent
939bc817e6
commit
dc94060e7e
|
@ -237,8 +237,8 @@ namespace Utils
|
||||||
while((offset = path.find("//")) != std::string::npos)
|
while((offset = path.find("//")) != std::string::npos)
|
||||||
path.erase(offset, 1);
|
path.erase(offset, 1);
|
||||||
|
|
||||||
// remove trailing '/'
|
// remove trailing '/' when the path is more than a simple '/'
|
||||||
while(path.length() && ((offset = path.find_last_of('/')) == (path.length() - 1)))
|
while(path.length() > 1 && ((offset = path.find_last_of('/')) == (path.length() - 1)))
|
||||||
path.erase(offset, 1);
|
path.erase(offset, 1);
|
||||||
|
|
||||||
// return generic path
|
// return generic path
|
||||||
|
|
Loading…
Reference in a new issue