forked from qt-creator/qt-creator
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:
@@ -879,6 +879,9 @@ bool UnixDeviceFileAccess::iterateWithFind(
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
const FilePath fp = filePath.withNewPath(fileName);
|
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);
|
return std::get<1>(callBack)(fp, fi);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user