tests show PSP doesn't tolerate extra /s at the end in an ISO

This commit is contained in:
KentuckyCompass 2015-09-07 18:56:18 -07:00
parent 4f0ec690a7
commit c7d24407ee

View file

@ -336,7 +336,7 @@ ISOFileSystem::TreeEntry *ISOFileSystem::GetFromPath(const std::string &path, bo
size_t nextSlashIndex = path.find_first_of('/', pathIndex);
if (nextSlashIndex == std::string::npos)
nextSlashIndex = pathLength;
const std::string firstPathComponent = path.substr(pathIndex, nextSlashIndex - pathIndex);
auto child = e->fastChildren.find(firstPathComponent);
if (child != e->fastChildren.end()) {
@ -350,7 +350,7 @@ ISOFileSystem::TreeEntry *ISOFileSystem::GetFromPath(const std::string &path, bo
{
e = ne;
pathIndex += name.length();
while (pathIndex < pathLength && path[pathIndex] == '/')
if (pathIndex < pathLength && path[pathIndex] == '/')
++pathIndex;
if (pathLength <= pathIndex)