* BugFix: Correct the VFS dumpDirectories function not honoring noBasePath properly.

This commit is contained in:
Robert MacGregor 2021-12-19 01:18:52 -05:00
parent 7665076b19
commit 46b8c3d15d

View file

@ -602,8 +602,23 @@ bool MountSystem::_dumpDirectories(DirectoryRef directory, Vector<StringTableEnt
for (U32 iteration = 0; iteration < directoryPaths.size(); ++iteration)
{
directories.push_back(StringTable->insert(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]);