瀏覽代碼

Fix dir manipulation off by one error in Android DirExists() function. Closes #1470.

Lasse Öörni 9 年之前
父節點
當前提交
761afff122
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Source/Urho3D/IO/FileSystem.cpp

+ 1 - 1
Source/Urho3D/IO/FileSystem.cpp

@@ -641,7 +641,7 @@ bool FileSystem::DirExists(const String& pathName) const
         unsigned pos = assetPath.FindLast('/', assetPath.Length() - 2);
         unsigned pos = assetPath.FindLast('/', assetPath.Length() - 2);
         if (pos != String::NPOS)
         if (pos != String::NPOS)
         {
         {
-            parentPath = assetPath.Substring(0, pos - 1);
+            parentPath = assetPath.Substring(0, pos);
             assetPath = assetPath.Substring(pos + 1);
             assetPath = assetPath.Substring(pos + 1);
         }
         }
         assetPath.Resize(assetPath.Length() - 1);
         assetPath.Resize(assetPath.Length() - 1);