Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

vfs: Fix getting URI filename

t8956225561685e9
diff --git a/src/core/file_sys/vfs/vfs_real.cpp b/src/core/file_sys/vfs/vfs_real.cpp
index 627d5d2517..3ad073e4ab 100644
--- a/src/core/file_sys/vfs/vfs_real.cpp
+++ b/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());
}