Utils: Don't return self during find

find can return the directory that is searched in as
one of the results. We need to filter it out.

Change-Id: If2902497e67d3a7a216430e725ec86227a392ccb
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-10-19 09:35:14 +02:00
parent 638e73e4f8
commit 4cab804e85

View File

@@ -879,6 +879,9 @@ bool UnixDeviceFileAccess::iterateWithFind(
return true;
const FilePath fp = filePath.withNewPath(fileName);
// Do not return the entry for the directory we are searching in.
if (fp.path() == filePath.path())
return true;
return std::get<1>(callBack)(fp, fi);
};