1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 05:23:04 +01:00

Refactor/Improve String and Path Handling

This commit is contained in:
LRFLEW
2016-09-25 21:24:29 -05:00
parent 211a0d7863
commit e5ff7412e4
94 changed files with 1038 additions and 989 deletions

View File

@@ -36,8 +36,7 @@ namespace Path
utf8 * GetDirectory(utf8 * buffer, size_t bufferSize, const utf8 * path)
{
const char pathSeperator = platform_get_path_separator();
size_t lastPathSepIndex = String::LastIndexOf(path, pathSeperator);
size_t lastPathSepIndex = String::LastIndexOf(path, *PATH_SEPARATOR);
if (lastPathSepIndex == SIZE_MAX)
{
return String::Set(buffer, bufferSize, String::Empty);
@@ -54,7 +53,7 @@ namespace Path
const utf8 * lastPathSeperator = nullptr;
for (const utf8 * ch = path; *ch != '\0'; ch++)
{
if (*ch == platform_get_path_separator())
if (*ch == *PATH_SEPARATOR)
{
lastPathSeperator = ch;
}