diff --git a/src/libs/utils/devicefileaccess.cpp b/src/libs/utils/devicefileaccess.cpp index 6123cd6751c..517004f2732 100644 --- a/src/libs/utils/devicefileaccess.cpp +++ b/src/libs/utils/devicefileaccess.cpp @@ -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); };