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
This commit is contained in:
Rene Gollent 2008-12-02 00:41:02 +00:00
parent 4ebaf16fab
commit 91da321846
1 changed files with 3 additions and 1 deletions

View File

@ -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;