From 31cf699e69808403b6533b08b3194af24cac2eab Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 9 May 2024 10:44:35 -0700 Subject: [PATCH] QFileSystemEngine::canonicalName: skip QDir::cleanPath() realpath() is supposed to return the canonicalized absolute path, so there should be nothing left to clean. Pick-to: 6.8 Change-Id: Ie30a3caf09ef4176bb36fffd17cde30c7538dba9 Reviewed-by: Ahmad Samir --- src/corelib/io/qfilesystemengine_unix.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 8a4072098cb..3be4873f4d6 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -677,8 +677,7 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, if (resolved_name) { data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute; data.entryFlags |= QFileSystemMetaData::ExistsAttribute; - QString canonicalPath = QDir::cleanPath(QFile::decodeName(resolved_name)); - return QFileSystemEntry(canonicalPath); + return QFileSystemEntry(resolved_name, QFileSystemEntry::FromNativePath{}); } else if (errno == ENOENT || errno == ENOTDIR) { // file doesn't exist data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute; data.entryFlags &= ~(QFileSystemMetaData::ExistsAttribute);