mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-25 03:40:40 +00:00
Allow top-level prefix to be found in the middle of a path
This commit is contained in:
parent
4d0aece001
commit
db5a43db30
@ -75,6 +75,17 @@ std::string Misc::ResourceHelpers::correctResourcePath(
|
|||||||
needsPrefix = false;
|
needsPrefix = false;
|
||||||
break;
|
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)
|
if (needsPrefix)
|
||||||
correctedPath = std::string{ topLevelDirectories.front() } + '\\' + correctedPath;
|
correctedPath = std::string{ topLevelDirectories.front() } + '\\' + correctedPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user