Also normalize paths in mod_file_exists() (#1045)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run

* Normalize paths in mod_file_exists()

* Make consistent with existing code
This commit is contained in:
rPhase 2025-11-29 16:23:43 -08:00 committed by GitHub
parent 796111cc6e
commit 77ca4db299
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -570,6 +570,7 @@ bool mod_file_exists(const char* filename) {
if (gLuaActiveMod == NULL) { return false; }
char normPath[SYS_MAX_PATH] = { 0 };
char normRelative[SYS_MAX_PATH] = { 0 };
if (snprintf(normPath, sizeof(normPath), "%s", filename) < 0) {
LOG_ERROR("Failed to copy filename for normalization: %s", filename);
@ -579,7 +580,9 @@ bool mod_file_exists(const char* filename) {
for (s32 i = 0; i < gLuaActiveMod->fileCount; i++) {
struct ModFile* file = &gLuaActiveMod->files[i];
if (!strcmp(file->relativePath, normPath)) {
strcpy(normRelative, file->relativePath);
normalize_path(normRelative);
if (!strcmp(normRelative, normPath)) {
return true;
}
}