diff options
| author | Peter Penz <[email protected]> | 2011-01-16 12:38:45 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-01-16 12:38:45 +0000 |
| commit | d650a50d10f0622e0d548316ba666797f5034190 (patch) | |
| tree | 15b07d8678ca19081a197112c9b158bf0a10d719 /src | |
| parent | 732b46e39ace58b3f429307a4b2af707a96faef5 (diff) | |
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
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); |
