Allow top-level prefix to be found in the middle of a path

fix-osga-rotate-wildly
AnyOldName3 1 year ago
parent 4d0aece001
commit db5a43db30

@ -75,6 +75,17 @@ std::string Misc::ResourceHelpers::correctResourcePath(
needsPrefix = false;
break;
}
else
{
std::string topLevelPrefix = std::string{ potentialTopLevelDirectory } + '\\';
size_t topLevelPos = correctedPath.find('\\' + topLevelPrefix);
if (topLevelPos != std::string::npos)
{
correctedPath.erase(0, topLevelPos + 1);
needsPrefix = false;
break;
}
}
}
if (needsPrefix)
correctedPath = std::string{ topLevelDirectories.front() } + '\\' + correctedPath;

Loading…
Cancel
Save