瀏覽代碼

vfs: Fix getting URI filename

t895 2 年之前
父節點
當前提交
f2fb761bac
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/core/file_sys/vfs/vfs_real.cpp

+ 9 - 0
src/core/file_sys/vfs/vfs_real.cpp

@@ -20,6 +20,10 @@
 #define stat _stat64
 #endif
 
+#ifdef ANDROID
+#include "common/fs/fs_android.h"
+#endif
+
 namespace FileSys {
 
 namespace FS = Common::FS;
@@ -274,6 +278,11 @@ RealVfsFile::~RealVfsFile() {
 }
 
 std::string RealVfsFile::GetName() const {
+#ifdef ANDROID
+    if (path[0] != '/') {
+        return FS::Android::GetFilename(path);
+    }
+#endif
     return path_components.empty() ? "" : std::string(path_components.back());
 }