Browse Source

Path::includes now properly handles the case when parent path has a filename

BearishSun 10 years ago
parent
commit
dbc17204cd
1 changed files with 16 additions and 2 deletions
  1. 16 2
      BansheeUtility/Source/BsPath.cpp

+ 16 - 2
BansheeUtility/Source/BsPath.cpp

@@ -294,8 +294,22 @@ namespace BansheeEngine
 				return false;
 		}
 
-		if (isFile() && mFilename != child.mFilename)
-			return false;
+		if (!mFilename.empty())
+		{
+			if (iterChild == child.mDirectories.end())
+			{
+				if (child.mFilename.empty())
+					return false;
+
+				if (!comparePathElem(child.mFilename, mFilename))
+					return false;
+			}
+			else
+			{
+				if (!comparePathElem(*iterChild, mFilename))
+					return false;
+			}			
+		}
 
 		return true;
 	}