Skip to content

Commit cc7dbee

Browse files
authored
[GEN][ZH] Downgrade debug assertion to log for isPathInDirectory (#1128)
1 parent 52b6eb0 commit cc7dbee

File tree

4 files changed

+2
-2
lines changed

4 files changed

+2
-2
lines changed

Generals/Code/GameEngine/Source/Common/System/FileSystem.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ Bool FileSystem::isPathInDirectory(const AsciiString& testPath, const AsciiStrin
367367
if (!testPathNormalized.startsWith(basePathNormalized))
368368
#endif
369369
{
370-
DEBUG_CRASH(("Normalized file path for '%s': '%s' was outside the expected base path of '%s' (normalized: '%s').\n", testPath.str(), testPathNormalized.str(), basePath.str(), basePathNormalized.str()));
371370
return false;
372371
}
373372

Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ AsciiString GameState::portableMapPathToRealMapPath(const AsciiString& in) const
936936

937937
if (!FileSystem::isPathInDirectory(prefix, containingBasePath))
938938
{
939+
DEBUG_LOG(("Normalized file path for '%s' was outside the expected base path of '%s'.\n", prefix.str(), containingBasePath.str()));
939940
return AsciiString::TheEmptyString;
940941
}
941942

GeneralsMD/Code/GameEngine/Source/Common/System/FileSystem.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ Bool FileSystem::isPathInDirectory(const AsciiString& testPath, const AsciiStrin
384384
if (!testPathNormalized.startsWith(basePathNormalized))
385385
#endif
386386
{
387-
DEBUG_CRASH(("Normalized file path for '%s': '%s' was outside the expected base path of '%s' (normalized: '%s').\n", testPath.str(), testPathNormalized.str(), basePath.str(), basePathNormalized.str()));
388387
return false;
389388
}
390389

GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ AsciiString GameState::portableMapPathToRealMapPath(const AsciiString& in) const
936936

937937
if (!FileSystem::isPathInDirectory(prefix, containingBasePath))
938938
{
939+
DEBUG_LOG(("Normalized file path for '%s' was outside the expected base path of '%s'.\n", prefix.str(), containingBasePath.str()));
939940
return AsciiString::TheEmptyString;
940941
}
941942

0 commit comments

Comments
 (0)