From 7541651a06591cb0fb8d8f88d657ca5c37bd5864 Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Mon, 30 Dec 2024 05:49:11 -0600 Subject: [PATCH] Fix subdir again --- src/Filesystem/SubdirFilesystem.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Filesystem/SubdirFilesystem.cpp b/src/Filesystem/SubdirFilesystem.cpp index bd89848..46daac0 100644 --- a/src/Filesystem/SubdirFilesystem.cpp +++ b/src/Filesystem/SubdirFilesystem.cpp @@ -1,4 +1,5 @@ #include "TessesFramework/Filesystem/SubdirFilesystem.hpp" +#include "TessesFramework/Filesystem/LocalFS.hpp" #include namespace Tesses::Framework::Filesystem { @@ -26,11 +27,19 @@ namespace Tesses::Framework::Filesystem VFSPath SubdirFilesystem::ToParent(VFSPath path) { - return VFSPath(this->path, path.CollapseRelativeParents()); + return this->path / path.CollapseRelativeParents(); } SubdirFilesystem::SubdirFilesystem(VFS* parent, VFSPath path, bool owns) { this->parent = parent; + if(dynamic_cast(parent) != nullptr) + { + Tesses::Framework::Filesystem::LocalFilesystem lfs; + auto curDir = std::filesystem::current_path(); + auto myPath = lfs.SystemToVFSPath(curDir.string()) / path; + this->path = myPath.CollapseRelativeParents(); + } + else this->path = path; this->owns=owns; }