mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-12-04 15:12:42 +00:00
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
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:
parent
796111cc6e
commit
77ca4db299
1 changed files with 4 additions and 1 deletions
|
|
@ -570,6 +570,7 @@ bool mod_file_exists(const char* filename) {
|
||||||
if (gLuaActiveMod == NULL) { return false; }
|
if (gLuaActiveMod == NULL) { return false; }
|
||||||
|
|
||||||
char normPath[SYS_MAX_PATH] = { 0 };
|
char normPath[SYS_MAX_PATH] = { 0 };
|
||||||
|
char normRelative[SYS_MAX_PATH] = { 0 };
|
||||||
|
|
||||||
if (snprintf(normPath, sizeof(normPath), "%s", filename) < 0) {
|
if (snprintf(normPath, sizeof(normPath), "%s", filename) < 0) {
|
||||||
LOG_ERROR("Failed to copy filename for normalization: %s", filename);
|
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++) {
|
for (s32 i = 0; i < gLuaActiveMod->fileCount; i++) {
|
||||||
struct ModFile* file = &gLuaActiveMod->files[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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue