Skip to content

Commit 3ef20eb

Browse files
Megamouseelad335
authored andcommitted
Fix iso path checks
1 parent da5d5e5 commit 3ef20eb

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

rpcs3/main_application.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -397,24 +397,19 @@ EmuCallbacks main_application::CreateCallbacks()
397397
fi.setFile(fi.path());
398398
}
399399

400-
const QString result = QDir(fi.canonicalFilePath()).filePath(tail);
400+
QString result = QDir::cleanPath(QDir(fi.canonicalFilePath()).filePath(tail));
401401

402402
#ifdef _WIN32
403-
std::string result_with_drive = QDir::cleanPath(result).toStdString();
404-
405-
if (!tail.isEmpty() && sv.starts_with("/") && !sv.starts_with("//"))
403+
if (sv.starts_with("/") && !sv.starts_with("//"))
406404
{
407405
// Erase absolute path for non-existant path
408-
if (result_with_drive.size() > 1 && result_with_drive[1] == ':')
406+
if (result.size() >= 3 && result[1] == ':' && result[2] == '/')
409407
{
410-
result_with_drive.erase(result_with_drive.begin(), result_with_drive.begin() + 2);
408+
result.remove(0, 2);
411409
}
412410
}
413-
414-
return result_with_drive;
415-
#else
416-
return QDir::cleanPath(result).toStdString();
417411
#endif
412+
return result.toStdString();
418413
};
419414

420415
callbacks.get_font_dirs = []()

0 commit comments

Comments
 (0)