From 63df9283035b7f221dcef0cd5d1e488da3af12b6 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 1 May 2015 23:23:03 -0400 Subject: Perform case-insensitive check for .lmp extension. When using the -playdemo parameter, we support a convenience feature where the .lmp extension is not appended if it is already part of the filename. This makes tab completion much nicer. But if the .lmp file has a filename that is in all-caps (.LMP) we were still appending the extension because the check was case sensitive. Change the check to be case insensitive. This fixes #501 (thanks Ioan Chera). --- src/heretic/d_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/heretic') 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, -- cgit v1.2.3