From 4ebaf16fab2cacfae2e5bd03c9ed8f34927403f8 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 2 Dec 2008 00:19:40 +0000 Subject: [PATCH] We need to check if we have an exact match in order to match BeOS's behavior (a directory is considered to contain itself on R5). Nice catch Axel! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28757 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/Directory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;