From c4b70358c83ded19955a48c42afef9199c66c36a Mon Sep 17 00:00:00 2001 From: Silent Date: Tue, 9 May 2023 21:08:46 +0200 Subject: [PATCH] More MAX_PATH removals (#20113) * Refactor FileScanner to lift a MAX_PATH limit * Replace Platform::EnsureDirectoryExists with Path::CreateDirectory * Remove MAX_PATH from Platform.Posix.cpp --- src/openrct2-ui/interface/Theme.cpp | 6 +- src/openrct2-ui/windows/InstallTrack.cpp | 3 +- src/openrct2-ui/windows/LoadSave.cpp | 2 +- src/openrct2/AssetPackManager.cpp | 4 +- src/openrct2/CommandLineSprite.cpp | 5 +- src/openrct2/Context.cpp | 12 ++-- src/openrct2/Game.cpp | 2 +- src/openrct2/core/FileIndex.hpp | 10 +-- src/openrct2/core/FileScanner.cpp | 75 +++++++++----------- src/openrct2/core/FileScanner.h | 8 +-- src/openrct2/core/Path.cpp | 13 +++- src/openrct2/core/Path.hpp | 3 +- src/openrct2/interface/Screenshot.cpp | 2 +- src/openrct2/network/NetworkBase.cpp | 9 +-- src/openrct2/platform/Platform.Posix.cpp | 57 +-------------- src/openrct2/platform/Platform.Win32.cpp | 7 -- src/openrct2/platform/Platform.h | 1 - src/openrct2/scenario/ScenarioRepository.cpp | 3 +- src/openrct2/title/TitleSequence.cpp | 3 +- test/tests/ReplayTests.cpp | 2 +- 20 files changed, 79 insertions(+), 148 deletions(-) diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 0f6feb6a84..1f9fd057b7 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -537,12 +537,12 @@ namespace ThemeManager auto scanner = Path::ScanDirectory(themesPattern, true); while (scanner->Next()) { - auto fileInfo = scanner->GetFileInfo(); - auto name = Path::GetFileNameWithoutExtension(std::string(fileInfo->Name)); + const auto& fileInfo = scanner->GetFileInfo(); + auto name = Path::GetFileNameWithoutExtension(fileInfo.Name); AvailableTheme theme{}; theme.Name = name; - theme.Path = GetThemeFileName(theme.Name); + theme.Path = GetThemeFileName(name); outThemes->push_back(std::move(theme)); if (Path::Equals(CurrentThemePath, scanner->GetPath())) diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 6aca68efae..9b91ae2141 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -370,7 +369,7 @@ private: { auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); auto destPath = env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::TRACK); - if (!Platform::EnsureDirectoryExists(destPath.c_str())) + if (!Path::CreateDirectory(destPath)) { LOG_ERROR("Unable to create directory '%s'", destPath.c_str()); ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index b50bcef1f6..739d3cba7d 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -882,7 +882,7 @@ public: case WIDX_NEW_FOLDER: { const u8string path = Path::Combine(_directory, text); - if (!Platform::EnsureDirectoryExists(path)) + if (!Path::CreateDirectory(path)) { ContextShowError(STR_UNABLE_TO_CREATE_FOLDER, STR_NONE, {}); return; diff --git a/src/openrct2/AssetPackManager.cpp b/src/openrct2/AssetPackManager.cpp index eb4b686d4b..e552a488ae 100644 --- a/src/openrct2/AssetPackManager.cpp +++ b/src/openrct2/AssetPackManager.cpp @@ -15,9 +15,9 @@ #include "config/Config.h" #include "core/Console.hpp" #include "core/FileSystem.hpp" +#include "core/Path.hpp" #include "core/String.hpp" #include "object/AudioSampleTable.h" -#include "platform/Platform.h" #include @@ -72,7 +72,7 @@ void AssetPackManager::Scan() Scan(openrct2Dir); auto userDirectory = fs::u8path(env->GetDirectoryPath(DIRBASE::USER, DIRID::ASSET_PACK)); - Platform::EnsureDirectoryExists(userDirectory.u8string()); + Path::CreateDirectory(userDirectory.u8string()); Scan(userDirectory); } diff --git a/src/openrct2/CommandLineSprite.cpp b/src/openrct2/CommandLineSprite.cpp index 6a01c3b10c..f62df01455 100644 --- a/src/openrct2/CommandLineSprite.cpp +++ b/src/openrct2/CommandLineSprite.cpp @@ -20,7 +20,6 @@ #include "object/ObjectLimits.h" #include "object/ObjectManager.h" #include "object/ObjectRepository.h" -#include "platform/Platform.h" #include "util/Util.h" #include @@ -370,7 +369,7 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc) return -1; } - if (!Platform::EnsureDirectoryExists(outputPath)) + if (!Path::CreateDirectory(outputPath)) { fprintf(stderr, "Unable to create directory.\n"); return -1; @@ -430,7 +429,7 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc) auto& objManager = context->GetObjectManager(); const auto* const metaObject = objManager.GetLoadedObject(objectType, entryIndex); - if (!Platform::EnsureDirectoryExists(outputPath)) + if (!Path::CreateDirectory(outputPath)) { fprintf(stderr, "Unable to create directory.\n"); return -1; diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 70eaf2c83e..df93445e00 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -1240,7 +1240,7 @@ namespace OpenRCT2 for (const auto& dirId : dirIds) { auto path = _env->GetDirectoryPath(dirBase, dirId); - if (!Platform::EnsureDirectoryExists(path.c_str())) + if (!Path::CreateDirectory(path)) LOG_ERROR("Unable to create directory '%s'.", path.c_str()); } } @@ -1274,14 +1274,10 @@ namespace OpenRCT2 auto dstDirectory = Path::GetDirectory(dst); // Create the directory if necessary - if (!Path::DirectoryExists(dstDirectory.c_str())) + if (!Path::CreateDirectory(dstDirectory)) { - Console::WriteLine("Creating directory '%s'", dstDirectory.c_str()); - if (!Platform::EnsureDirectoryExists(dstDirectory.c_str())) - { - Console::Error::WriteLine("Could not create directory %s.", dstDirectory.c_str()); - break; - } + Console::Error::WriteLine("Could not create directory %s.", dstDirectory.c_str()); + break; } // Only copy the file if it doesn't already exist diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 1c08e50f03..c551d1d9ce 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -704,7 +704,7 @@ void GameAutosave() auto env = GetContext()->GetPlatformEnvironment(); auto autosaveDir = Path::Combine(env->GetDirectoryPath(DIRBASE::USER, subDirectory), u8"autosave"); - Platform::EnsureDirectoryExists(autosaveDir.c_str()); + Path::CreateDirectory(autosaveDir); auto path = Path::Combine(autosaveDir, timeName); auto backupFileName = u8string(u8"autosave") + fileExtension + u8".bak"; diff --git a/src/openrct2/core/FileIndex.hpp b/src/openrct2/core/FileIndex.hpp index 7fa6b9e759..2196b2b01c 100644 --- a/src/openrct2/core/FileIndex.hpp +++ b/src/openrct2/core/FileIndex.hpp @@ -149,13 +149,13 @@ private: auto scanner = Path::ScanDirectory(pattern, true); while (scanner->Next()) { - auto fileInfo = scanner->GetFileInfo(); - auto path = std::string(scanner->GetPath()); + const auto& fileInfo = scanner->GetFileInfo(); + auto path = scanner->GetPath(); stats.TotalFiles++; - stats.TotalFileSize += fileInfo->Size; - stats.FileDateModifiedChecksum ^= static_cast(fileInfo->LastModified >> 32) - ^ static_cast(fileInfo->LastModified & 0xFFFFFFFF); + stats.TotalFileSize += fileInfo.Size; + stats.FileDateModifiedChecksum ^= static_cast(fileInfo.LastModified >> 32) + ^ static_cast(fileInfo.LastModified & 0xFFFFFFFF); stats.FileDateModifiedChecksum = Numerics::ror32(stats.FileDateModifiedChecksum, 5); stats.PathChecksum += GetPathChecksum(path); diff --git a/src/openrct2/core/FileScanner.cpp b/src/openrct2/core/FileScanner.cpp index 2394cad7a1..f8ff579227 100644 --- a/src/openrct2/core/FileScanner.cpp +++ b/src/openrct2/core/FileScanner.cpp @@ -50,7 +50,7 @@ struct DirectoryChild uint64_t LastModified = 0; }; -static uint32_t GetPathChecksum(const utf8* path); +static uint32_t GetPathChecksum(u8string_view path); static bool MatchWildcard(const utf8* fileName, const utf8* pattern); class FileScannerBase : public IFileScanner @@ -58,64 +58,54 @@ class FileScannerBase : public IFileScanner private: struct DirectoryState { - std::string Path; + u8string Path; std::vector Listing; int32_t Index = 0; }; // Options - std::string _rootPath; - std::vector _patterns; - bool _recurse; + const u8string _rootPath; + const std::vector _patterns; + const bool _recurse; // State bool _started = false; std::stack _directoryStack; // Current - FileScanner::FileInfo* _currentFileInfo; - utf8* _currentPath; + FileScanner::FileInfo _currentFileInfo; + u8string _currentPath; public: - FileScannerBase(const std::string& pattern, bool recurse) + FileScannerBase(u8string_view pattern, bool recurse) + : _rootPath(Path::GetDirectory(pattern)) + , _patterns(GetPatterns(Path::GetFileName(pattern))) + , _recurse(recurse) { - _rootPath = Path::GetDirectory(pattern); - _recurse = recurse; - _patterns = GetPatterns(Path::GetFileName(pattern)); - - _currentPath = Memory::Allocate(MAX_PATH); - _currentFileInfo = Memory::Allocate(); - - Reset(); } - ~FileScannerBase() override - { - Memory::Free(_currentPath); - Memory::Free(_currentFileInfo); - } + ~FileScannerBase() override = default; - const FileScanner::FileInfo* GetFileInfo() const override + const FileScanner::FileInfo& GetFileInfo() const override { return _currentFileInfo; } - const utf8* GetPath() const override + const u8string& GetPath() const override { return _currentPath; } - const utf8* GetPathRelative() const override + u8string GetPathRelative() const override { - // +1 to remove the path separator - return _currentPath + _rootPath.size() + 1; + return Path::GetRelative(_currentPath, _rootPath); } void Reset() override { _started = false; - _directoryStack = std::stack(); - _currentPath[0] = 0; + _directoryStack = {}; + _currentPath.clear(); } bool Next() override @@ -147,12 +137,11 @@ public: } else if (PatternMatch(child->Name)) { - auto path = Path::Combine(state->Path, child->Name); - String::Set(_currentPath, MAX_PATH, path.c_str()); + _currentPath = Path::Combine(state->Path, child->Name); - _currentFileInfo->Name = child->Name.c_str(); - _currentFileInfo->Size = child->Size; - _currentFileInfo->LastModified = child->LastModified; + _currentFileInfo.Name = child->Name; + _currentFileInfo.Size = child->Size; + _currentFileInfo.LastModified = child->LastModified; return true; } } @@ -216,7 +205,7 @@ private: class FileScannerWindows final : public FileScannerBase { public: - FileScannerWindows(const std::string& pattern, bool recurse) + FileScannerWindows(u8string_view pattern, bool recurse) : FileScannerBase(pattern, recurse) { } @@ -269,7 +258,7 @@ private: class FileScannerUnix final : public FileScannerBase { public: - FileScannerUnix(const std::string& pattern, bool recurse) + FileScannerUnix(u8string_view pattern, bool recurse) : FileScannerBase(pattern, recurse) { } @@ -349,13 +338,13 @@ void Path::QueryDirectory(QueryDirectoryResult* result, const std::string& patte auto scanner = Path::ScanDirectory(pattern, true); while (scanner->Next()) { - const FileScanner::FileInfo* fileInfo = scanner->GetFileInfo(); - const utf8* path = scanner->GetPath(); + const FileScanner::FileInfo& fileInfo = scanner->GetFileInfo(); + const u8string& path = scanner->GetPath(); result->TotalFiles++; - result->TotalFileSize += fileInfo->Size; - result->FileDateModifiedChecksum ^= static_cast(fileInfo->LastModified >> 32) - ^ static_cast(fileInfo->LastModified & 0xFFFFFFFF); + result->TotalFileSize += fileInfo.Size; + result->FileDateModifiedChecksum ^= static_cast(fileInfo.LastModified >> 32) + ^ static_cast(fileInfo.LastModified & 0xFFFFFFFF); result->FileDateModifiedChecksum = Numerics::ror32(result->FileDateModifiedChecksum, 5); result->PathChecksum += GetPathChecksum(path); } @@ -380,12 +369,12 @@ std::vector Path::GetDirectories(const std::string& path) return subDirectories; } -static uint32_t GetPathChecksum(const utf8* path) +static uint32_t GetPathChecksum(u8string_view path) { uint32_t hash = 0xD8430DED; - for (const utf8* ch = path; *ch != '\0'; ch++) + for (const utf8 ch : path) { - hash += (*ch); + hash += ch; hash += (hash << 10); hash ^= (hash >> 6); } diff --git a/src/openrct2/core/FileScanner.h b/src/openrct2/core/FileScanner.h index da319d3fbd..f4b343598a 100644 --- a/src/openrct2/core/FileScanner.h +++ b/src/openrct2/core/FileScanner.h @@ -20,7 +20,7 @@ namespace FileScanner { struct FileInfo { - const utf8* Name; + u8string Name; uint64_t Size; uint64_t LastModified; }; @@ -30,9 +30,9 @@ struct IFileScanner { virtual ~IFileScanner() = default; - virtual const FileScanner::FileInfo* GetFileInfo() const abstract; - virtual const utf8* GetPath() const abstract; - virtual const utf8* GetPathRelative() const abstract; + virtual const FileScanner::FileInfo& GetFileInfo() const abstract; + virtual const u8string& GetPath() const abstract; + virtual u8string GetPathRelative() const abstract; virtual void Reset() abstract; virtual bool Next() abstract; diff --git a/src/openrct2/core/Path.cpp b/src/openrct2/core/Path.cpp index 894a097224..d7287e3fcb 100644 --- a/src/openrct2/core/Path.cpp +++ b/src/openrct2/core/Path.cpp @@ -53,9 +53,12 @@ namespace Path return fs::u8path(path).parent_path().u8string(); } - void CreateDirectory(u8string_view path) + bool CreateDirectory(u8string_view path) { - Platform::EnsureDirectoryExists(u8string(path).c_str()); + std::error_code ec; + fs::create_directories(fs::u8path(path), ec); + // create_directories returns false if the directory already exists, but the error code is zero. + return ec.value() == 0; } bool DirectoryExists(u8string_view path) @@ -97,6 +100,12 @@ namespace Path return fs::absolute(fs::u8path(relative), ec).u8string(); } + u8string GetRelative(u8string_view path, u8string_view base) + { + std::error_code ec; + return fs::relative(fs::u8path(path), fs::u8path(base), ec).u8string(); + } + bool Equals(u8string_view a, u8string_view b) { return String::Equals(a, b, Platform::ShouldIgnoreCase()); diff --git a/src/openrct2/core/Path.hpp b/src/openrct2/core/Path.hpp index 8ccf2aea39..5653116e5d 100644 --- a/src/openrct2/core/Path.hpp +++ b/src/openrct2/core/Path.hpp @@ -24,7 +24,7 @@ namespace Path } u8string GetDirectory(u8string_view path); - void CreateDirectory(u8string_view path); + bool CreateDirectory(u8string_view path); bool DirectoryExists(u8string_view path); bool DeleteDirectory(u8string_view path); u8string GetFileName(u8string_view origPath); @@ -33,6 +33,7 @@ namespace Path u8string WithExtension(u8string_view path, u8string_view newExtension); bool IsAbsolute(u8string_view path); u8string GetAbsolute(u8string_view relative); + u8string GetRelative(u8string_view path, u8string_view base); bool Equals(u8string_view a, u8string_view b); /** diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index d4665e5950..5533aad5f6 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -134,7 +134,7 @@ static std::string ScreenshotGetFormattedDateTime() static std::optional ScreenshotGetNextPath() { auto screenshotDirectory = ScreenshotGetDirectory(); - if (!Platform::EnsureDirectoryExists(screenshotDirectory.c_str())) + if (!Path::CreateDirectory(screenshotDirectory)) { LOG_ERROR("Unable to save screenshots in OpenRCT2 screenshot directory."); return std::nullopt; diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index f7cbb8ed99..dc0716b616 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -292,7 +292,7 @@ bool NetworkBase::BeginClient(const std::string& host, uint16_t port) Console::WriteLine("Key generated, saving private bits as %s", keyPath.c_str()); const auto keysDirectory = NetworkGetKeysDirectory(); - if (!Platform::EnsureDirectoryExists(keysDirectory.c_str())) + if (!Path::CreateDirectory(keysDirectory)) { LOG_ERROR("Unable to create directory %s.", keysDirectory.c_str()); return false; @@ -1071,8 +1071,9 @@ std::string NetworkBase::BeginLog(const std::string& directory, const std::strin throw std::runtime_error("strftime failed"); } - Platform::EnsureDirectoryExists(Path::Combine(directory, midName).c_str()); - return Path::Combine(directory, midName, filename); + auto directoryMidName = Path::Combine(directory, midName); + Path::CreateDirectory(directoryMidName); + return Path::Combine(directoryMidName, filename); } void NetworkBase::AppendLog(std::ostream& fs, std::string_view s) @@ -2495,7 +2496,7 @@ void NetworkBase::Client_Handle_GAMESTATE(NetworkConnection& connection, Network std::string outputPath = GetContext().GetPlatformEnvironment()->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_DESYNCS); - Platform::EnsureDirectoryExists(outputPath.c_str()); + Path::CreateDirectory(outputPath); char uniqueFileName[128] = {}; snprintf( diff --git a/src/openrct2/platform/Platform.Posix.cpp b/src/openrct2/platform/Platform.Posix.cpp index 449e2146a0..76606501d3 100644 --- a/src/openrct2/platform/Platform.Posix.cpp +++ b/src/openrct2/platform/Platform.Posix.cpp @@ -31,9 +31,7 @@ # include // The name of the mutex used to prevent multiple instances of the game from running -static constexpr u8string_view SINGLE_INSTANCE_MUTEX_NAME = u8"openrct2.lock"; - -static utf8 _userDataDirectoryPath[MAX_PATH] = { 0 }; +static constexpr const utf8* SINGLE_INSTANCE_MUTEX_NAME = u8"openrct2.lock"; namespace Platform { @@ -307,64 +305,13 @@ namespace Platform # endif // __EMSCRIPTEN__ } - // Implement our own version of getumask(), as it is documented being - // "a vaporware GNU extension". - static mode_t openrct2_getumask() - { - mode_t mask = umask(0); - umask(mask); - return 0777 & ~mask; // Keep in mind 0777 is octal - } - - bool EnsureDirectoryExists(u8string_view path) - { - mode_t mask = openrct2_getumask(); - char buffer[MAX_PATH]; - SafeStrCpy(buffer, u8string(path).c_str(), sizeof(buffer)); - - LOG_VERBOSE("Create directory: %s", buffer); - for (char* p = buffer + 1; *p != '\0'; p++) - { - if (*p == '/') - { - // Temporarily truncate - *p = '\0'; - - LOG_VERBOSE("mkdir(%s)", buffer); - if (mkdir(buffer, mask) != 0) - { - if (errno != EEXIST) - { - return false; - } - } - - // Restore truncation - *p = '/'; - } - } - - LOG_VERBOSE("mkdir(%s)", buffer); - if (mkdir(buffer, mask) != 0) - { - if (errno != EEXIST) - { - return false; - } - } - - return true; - } - bool LockSingleInstance() { - auto pidFilePath = Path::Combine(_userDataDirectoryPath, SINGLE_INSTANCE_MUTEX_NAME); - // We will never close this file manually. The operating system will // take care of that, because flock keeps the lock as long as the // file is open and closes it automatically on file close. // This is intentional. - int32_t pidFile = open(pidFilePath.c_str(), O_CREAT | O_RDWR, 0666); + int32_t pidFile = open(SINGLE_INSTANCE_MUTEX_NAME, O_CREAT | O_RDWR, 0666); if (pidFile == -1) { diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp index 9eea08e3d3..85178dc975 100644 --- a/src/openrct2/platform/Platform.Win32.cpp +++ b/src/openrct2/platform/Platform.Win32.cpp @@ -786,13 +786,6 @@ namespace Platform return !path.empty() ? Path::Combine(path, font.filename) : std::string(); } - bool EnsureDirectoryExists(u8string_view path) - { - auto wPath = String::ToWideChar(path); - auto success = CreateDirectoryW(wPath.c_str(), nullptr); - return success != FALSE || GetLastError() == ERROR_ALREADY_EXISTS; - } - bool LockSingleInstance() { // Check if operating system mutex exists diff --git a/src/openrct2/platform/Platform.h b/src/openrct2/platform/Platform.h index c5527d63b9..1384fa3661 100644 --- a/src/openrct2/platform/Platform.h +++ b/src/openrct2/platform/Platform.h @@ -113,7 +113,6 @@ namespace Platform u8string StrDecompToPrecomp(u8string_view input); bool RequireNewWindow(bool openGL); - bool EnsureDirectoryExists(u8string_view path); // Returns the bitmask of the GetLogicalDrives function for windows, 0 for other systems int32_t GetDrives(); time_t FileGetModifiedTime(u8string_view path); diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 6b7a4c78aa..7e791fe974 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -536,8 +536,7 @@ private: */ void ConvertMegaPark(const std::string& srcPath, const std::string& dstPath) { - auto directory = Path::GetDirectory(dstPath); - Platform::EnsureDirectoryExists(directory.c_str()); + Path::CreateDirectory(Path::GetDirectory(dstPath)); auto mpdat = File::ReadAllBytes(srcPath); diff --git a/src/openrct2/title/TitleSequence.cpp b/src/openrct2/title/TitleSequence.cpp index 864f0bba44..4f349eb584 100644 --- a/src/openrct2/title/TitleSequence.cpp +++ b/src/openrct2/title/TitleSequence.cpp @@ -307,8 +307,7 @@ namespace OpenRCT2::Title auto scanner = Path::ScanDirectory(pattern, true); while (scanner->Next()) { - const utf8* path = scanner->GetPathRelative(); - saves.push_back(path); + saves.push_back(scanner->GetPathRelative()); } return saves; } diff --git a/test/tests/ReplayTests.cpp b/test/tests/ReplayTests.cpp index 72b7737205..7aee8464de 100644 --- a/test/tests/ReplayTests.cpp +++ b/test/tests/ReplayTests.cpp @@ -57,7 +57,7 @@ static std::vector GetReplayFiles() while (scanner->Next()) { ReplayTestData test; - test.name = sanitizeTestName(scanner->GetFileInfo()->Name); + test.name = sanitizeTestName(scanner->GetFileInfo().Name); test.filePath = scanner->GetPath(); res.push_back(std::move(test)); }