Fix strange validity check in BDirectory::Contains(). If either path ends up as
invalid it must not be used. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28015 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -505,7 +505,7 @@ BDirectory::Contains(const BEntry *entry, int32 nodeFlags) const
|
|||||||
// the entry and check, if the latter is a prefix of the first one.
|
// the entry and check, if the latter is a prefix of the first one.
|
||||||
BPath dirPath(this, ".", true);
|
BPath dirPath(this, ".", true);
|
||||||
BPath entryPath(entry);
|
BPath entryPath(entry);
|
||||||
if (dirPath.InitCheck() == B_OK && entryPath.InitCheck() != B_OK)
|
if (dirPath.InitCheck() != B_OK || entryPath.InitCheck() != B_OK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return !strncmp(dirPath.Path(), entryPath.Path(), strlen(dirPath.Path()));
|
return !strncmp(dirPath.Path(), entryPath.Path(), strlen(dirPath.Path()));
|
||||||
|
|||||||
Reference in New Issue
Block a user