diff options
author | Andrius Štikonas <andrius@stikonas.eu> | 2023-07-03 23:51:20 +0100 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-07-07 23:38:18 +0000 |
commit | 25b4bd5841401119c90f2ac1d49b74f2415ec40f (patch) | |
tree | 8a2bd434992de7552768bd484b0bc9bdcda420fd | |
parent | 4b7b5edf26b895932d0bee2d3315989c41c2d283 (diff) |
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 <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/io/qstorageinfo_unix.cpp | 4 |
1 files changed, 1 insertions, 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; |