From 55ab987c9a518f217c02ca1382656ac97c53b307 Mon Sep 17 00:00:00 2001 From: Karsten Heimrich Date: Tue, 28 Sep 2021 13:56:16 +0200 Subject: Fix QDir::entryList to work for directories that end with '.lnk' In addition to checking the .lnk extension, check that the the specified path is not a path to a directory. Pick-to: 6.2 Fixes: QTBUG-85058 Change-Id: I83cef3d94c6ffa82a88f374c5b41779e88fe40b8 Reviewed-by: Friedemann Kleint Reviewed-by: Edward Welbourne Reviewed-by: Kai Koehne Reviewed-by: Qt CI Bot --- src/corelib/io/qfilesystemiterator_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io/qfilesystemiterator_win.cpp') diff --git a/src/corelib/io/qfilesystemiterator_win.cpp b/src/corelib/io/qfilesystemiterator_win.cpp index 1b65ae3c09..ac52dacdce 100644 --- a/src/corelib/io/qfilesystemiterator_win.cpp +++ b/src/corelib/io/qfilesystemiterator_win.cpp @@ -59,7 +59,7 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi { Q_UNUSED(nameFilters); Q_UNUSED(flags); - if (nativePath.endsWith(QLatin1String(".lnk"))) { + if (nativePath.endsWith(u".lnk"_qs) && !QFileSystemEngine::isDirPath(dirPath, nullptr)) { QFileSystemMetaData metaData; QFileSystemEntry link = QFileSystemEngine::getLinkTarget(entry, metaData); nativePath = link.nativeFilePath(); -- cgit v1.2.3