Directly return the fs root if the path is "/"

This commit is contained in:
Alex 2023-03-25 12:00:43 +02:00
parent 2d03d629dc
commit e3a544e79c
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -531,6 +531,14 @@ namespace VirtualFileSystem
vfsdbg("Opening %s with parent %s", Path, Parent ? Parent->Name : "(null)");
const char *basename;
if (strcmp(Path, "/") == 0)
{
std::shared_ptr<File> file = std::make_shared<File>();
file->node = FileSystemRoot;
strcpy(file->Name, "/");
return file;
}
if (strcmp(Path, ".") == 0)
{
std::shared_ptr<File> file = std::make_shared<File>();