From 91da321846140e32285bad8701b080b0e3e30535 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 2 Dec 2008 00:41:02 +0000 Subject: [PATCH] Remove unnecessary length check, and add a clarifying comment. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28758 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/Directory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kits/storage/Directory.cpp b/src/kits/storage/Directory.cpp index 280e3dbd8a..fbcf9ae359 100644 --- a/src/kits/storage/Directory.cpp +++ b/src/kits/storage/Directory.cpp @@ -511,7 +511,9 @@ 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 the paths are identical, return a match to stay consistent with + // BeOS behavior. + if (entryPath.Path()[dirLen] == '\0' || entryPath.Path()[dirLen] == '/') return true; } return false;