From fbbad7c85159e7d1ee8e844591c246f416cd9267 Mon Sep 17 00:00:00 2001 From: Silent Date: Wed, 5 Feb 2020 19:38:57 +0100 Subject: [PATCH] Include trailing separators in section split This fixes the case on Windows where one of the paths ends up consisting only of a drive letter and no trailing slash - in which case Windows treats it as "current directory on drive X" and not "root of drive X" and GetFileAttributes throws an invalid param error --- rpcs3/rpcs3qt/qt_utils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcs3/rpcs3qt/qt_utils.cpp b/rpcs3/rpcs3qt/qt_utils.cpp index 00d4edd282..37b167c46a 100644 --- a/rpcs3/rpcs3qt/qt_utils.cpp +++ b/rpcs3/rpcs3qt/qt_utils.cpp @@ -238,7 +238,8 @@ namespace gui { // get Icon for the gs_frame from path. this handles presumably all possible use cases const QString qpath = qstr(path); - const std::string path_list[] = { path, sstr(qpath.section("/", 0, -2)), sstr(qpath.section("/", 0, -3)) }; + const std::string path_list[] = { path, sstr(qpath.section("/", 0, -2, QString::SectionIncludeTrailingSep)), + sstr(qpath.section("/", 0, -3, QString::SectionIncludeTrailingSep)) }; for (const std::string& pth : path_list) {