From 46b8c3d15ded542d1d1c78e89d5e77310b2be782 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Sun, 19 Dec 2021 01:18:52 -0500 Subject: [PATCH] * BugFix: Correct the VFS dumpDirectories function not honoring noBasePath properly. --- Engine/source/core/volume.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Engine/source/core/volume.cpp b/Engine/source/core/volume.cpp index 090dc43f7..3f4b79c42 100644 --- a/Engine/source/core/volume.cpp +++ b/Engine/source/core/volume.cpp @@ -602,8 +602,23 @@ bool MountSystem::_dumpDirectories(DirectoryRef directory, Vectorinsert(directoryPaths[iteration].getFullPath().c_str(), true)); + const Path& directoryPath = directoryPaths[iteration]; + String directoryPathString = directoryPath.getFullPath().c_str(); + if (noBasePath) + { + Path newDirectoryPath; + for (U32 iteration = basePath.getDirectoryCount() + 1; iteration < directoryPath.getDirectoryCount(); ++iteration) + { + newDirectoryPath.appendPath(directoryPath.getDirectory(iteration)); + } + + newDirectoryPath.setFileName(directoryPath.getFileName()); + newDirectoryPath.setExtension(directoryPath.getExtension()); + directoryPathString = newDirectoryPath.getFullPathWithoutRoot(); + } + + directories.push_back(StringTable->insert(directoryPathString, true)); if (currentDepth <= depth) { DirectoryRef nextDirectory = OpenDirectory(directoryPaths[iteration]);