From d650a50d10f0622e0d548316ba666797f5034190 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 16 Jan 2011 12:38:45 +0000 Subject: [PATCH] Assure that no endless searching is done if a link points to a parent directory CCBUG: 263262 FIXED-IN: 4.6.0 svn path=/trunk/KDE/kdebase/apps/; revision=1214807 --- src/search/filenamesearchprotocol.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/search/filenamesearchprotocol.cpp b/src/search/filenamesearchprotocol.cpp index f50d9ebd9..8464205ff 100644 --- a/src/search/filenamesearchprotocol.cpp +++ b/src/search/filenamesearchprotocol.cpp @@ -97,7 +97,18 @@ void FileNameSearchProtocol::searchDirectory(const KUrl& directory) } if (item.isDir()) { - pendingDirs.append(item.url()); + bool skipDir = false; + const KUrl itemDir = item.url(); + if (item.isLink()) { + // Assure that no endless searching is done if a link points + // to a parent directory + const KUrl linkDestDir = item.linkDest(); + skipDir = linkDestDir.isParentOf(itemDir); + } + + if (!skipDir) { + pendingDirs.append(itemDir); + } } } listEntry(KIO::UDSEntry(), true); -- 2.47.3