From e5c916a27c18d2ca09be322e20adc7731bfa73ab Mon Sep 17 00:00:00 2001
From: Subv <subv2112@gmail.com>
Date: Thu, 19 Jul 2018 13:11:09 -0500
Subject: [PATCH] Filesystem: Return EntryType::Directory for the root
 directory.

It is unknown if this is correct behavior, but it makes sense and fixes a regression with Stardew Valley.
---
 src/core/hle/service/filesystem/filesystem.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index ec528ef40..a97d70a58 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -193,6 +193,10 @@ ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType(
     if (dir == nullptr)
         return FileSys::ERROR_PATH_NOT_FOUND;
     auto filename = FileUtil::GetFilename(path);
+    // TODO(Subv): Some games use the '/' path, find out what this means.
+    if (filename.empty())
+        return MakeResult(FileSys::EntryType::Directory);
+
     if (dir->GetFile(filename) != nullptr)
         return MakeResult(FileSys::EntryType::File);
     if (dir->GetSubdirectory(filename) != nullptr)