Browse Source

Fixed not being able to enter the root directory with FileSelector.

Lasse Öörni 13 năm trước cách đây
mục cha
commit
160e6b0c14
1 tập tin đã thay đổi với 9 bổ sung3 xóa
  1. 9 3
      Engine/IO/FileSystem.cpp

+ 9 - 3
Engine/IO/FileSystem.cpp

@@ -393,9 +393,15 @@ bool FileSystem::DirExists(const String& pathName) const
 {
     if (!CheckAccess(pathName))
         return false;
-    
-    String fixedName = GetNativePath(RemoveTrailingSlash(pathName));
-    
+    
+    #ifndef WIN32
+    // Always return true for the root directory
+    if (pathName == "/")
+	return true;
+    #endif
+
+    String fixedName = GetNativePath(RemoveTrailingSlash(pathName));
+
     #ifdef ANDROID
     /// \todo Actually check for existence, now true is always returned for directories within the APK
     if (fixedName.StartsWith("/apk/"))