diff options
-rw-r--r-- | src/doom/d_main.c | 7 | ||||
-rw-r--r-- | src/heretic/d_main.c | 7 | ||||
-rw-r--r-- | src/hexen/h2_main.c | 8 | ||||
-rw-r--r-- | src/strife/d_main.c | 7 |
4 files changed, 25 insertions, 4 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c index eb9454ac..bcdfcaa3 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -1475,9 +1475,12 @@ void D_DoomMain (void) if (p) { + char *uc_filename = strdup(myargv[p + 1]); + M_ForceUppercase(uc_filename); + // With Vanilla you have to specify the file without extension, // but make that optional. - if (M_StringEndsWith(myargv[p + 1], ".lmp")) + if (M_StringEndsWith(uc_filename, ".LMP")) { M_StringCopy(file, myargv[p + 1], sizeof(file)); } @@ -1486,6 +1489,8 @@ void D_DoomMain (void) DEH_snprintf(file, sizeof(file), "%s.lmp", myargv[p+1]); } + free(uc_filename); + if (D_AddFile(file)) { M_StringCopy(demolumpname, lumpinfo[numlumps - 1].name, diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c index 2a57016f..beb876ca 100644 --- a/src/heretic/d_main.c +++ b/src/heretic/d_main.c @@ -1001,9 +1001,12 @@ void D_DoomMain(void) if (p) { + char *uc_filename = strdup(myargv[p + 1]); + M_ForceUppercase(uc_filename); + // In Vanilla, the filename must be specified without .lmp, // but make that optional. - if (M_StringEndsWith(myargv[p + 1], ".lmp")) + if (M_StringEndsWith(uc_filename, ".LMP")) { M_StringCopy(file, myargv[p + 1], sizeof(file)); } @@ -1012,6 +1015,8 @@ void D_DoomMain(void) DEH_snprintf(file, sizeof(file), "%s.lmp", myargv[p + 1]); } + free(uc_filename); + if (D_AddFile(file)) { M_StringCopy(demolumpname, lumpinfo[numlumps - 1].name, diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index 7084ceec..1786a1fb 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -623,17 +623,23 @@ static void HandleArgs(void) if (p) { + char *uc_filename; char file[256]; M_StringCopy(file, myargv[p+1], sizeof(file)); // With Vanilla Hexen you have to specify the file without // extension, but make that optional. - if (!M_StringEndsWith(myargv[p+1], ".lmp")) + uc_filename = strdup(myargv[p + 1]); + M_ForceUppercase(uc_filename); + + if (!M_StringEndsWith(uc_filename, ".LMP")) { M_StringConcat(file, ".lmp", sizeof(file)); } + free(uc_filename); + if (W_AddFile(file) != NULL) { M_StringCopy(demolumpname, lumpinfo[numlumps - 1].name, diff --git a/src/strife/d_main.c b/src/strife/d_main.c index 186ba28b..cc1a9022 100644 --- a/src/strife/d_main.c +++ b/src/strife/d_main.c @@ -1611,9 +1611,12 @@ void D_DoomMain (void) if (p) { + char *uc_filename = strdup(myargv[p + 1]); + M_ForceUppercase(uc_filename); + // With Vanilla you have to specify the file without extension, // but make that optional. - if (M_StringEndsWith(myargv[p + 1], ".lmp")) + if (M_StringEndsWith(uc_filename, ".LMP")) { M_StringCopy(file, myargv[p + 1], sizeof(file)); } @@ -1622,6 +1625,8 @@ void D_DoomMain (void) DEH_snprintf(file, sizeof(file), "%s.lmp", myargv[p+1]); } + free(uc_filename); + if (D_AddFile (file)) { M_StringCopy(demolumpname, lumpinfo[numlumps - 1].name, |