From 25b4bd5841401119c90f2ac1d49b74f2415ec40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Mon, 3 Jul 2023 23:51:20 +0100 Subject: [PATCH] QStorageInfo: Correctly decode backslash in file system labels At the moment labels such as "one\two" are incorrectly decoded as "one\x5ctwo". Backslashes were originally excluded after Thiago Maciera's review, see commit 8f1277da8c137270ff857128d8fea1423d8a7700. Now Thiago agrees that original reasoning for excluding backslash was incorrect and we do want to decode them. Pick-to: 6.5 6.6 Change-Id: I8f13fc678b40a7a9474a0171c50e3e221dfe85c8 Reviewed-by: Thiago Macieira --- src/corelib/io/qstorageinfo_unix.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index 47c414d733..34ff8bff84 100644 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@ -397,9 +397,7 @@ static QString decodeFsEncString(const QString &str) if (QStringView{str}.sliced(i).startsWith("\\x"_L1)) { bool bOk; const int code = QStringView{str}.mid(i+2, 2).toInt(&bOk, 16); - // only decode characters between 0x20 and 0x7f but not - // the backslash to prevent collisions - if (bOk && code >= 0x20 && code < 0x80 && code != '\\') { + if (bOk && code >= 0x20 && code < 0x80) { decoded += QChar(code); i += 4; continue;