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 <a.samirh78@gmail.com>
This commit is contained in:
Thiago Macieira 2024-05-09 10:44:35 -07:00
parent a1db295912
commit 31cf699e69

View File

@ -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);