diff --git a/src/kits/storage/Directory.cpp b/src/kits/storage/Directory.cpp index c8a96bf325..280e3dbd8a 100644 --- a/src/kits/storage/Directory.cpp +++ b/src/kits/storage/Directory.cpp @@ -511,7 +511,7 @@ BDirectory::Contains(const BEntry *entry, int32 nodeFlags) const uint32 dirLen = strlen(dirPath.Path()); if (!strncmp(dirPath.Path(), entryPath.Path(), dirLen)) { - if (strlen(entryPath.Path()) > dirLen && entryPath.Path()[dirLen] == '/') + if (strlen(entryPath.Path()) == dirLen || entryPath.Path()[dirLen] == '/') return true; } return false;