diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/search/filenamesearchprotocol.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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); |
