summaryrefslogtreecommitdiff
path: root/src/doom/d_main.c
diff options
context:
space:
mode:
authorSimon Howard2015-05-01 23:23:03 -0400
committerSimon Howard2015-05-01 23:23:03 -0400
commit63df9283035b7f221dcef0cd5d1e488da3af12b6 (patch)
tree93332df580cac4806aa8743626a503e5bd0d1748 /src/doom/d_main.c
parent4ee95eb27f4a71f78450d492a62e5abcd881c5c4 (diff)
downloadchocolate-doom-63df9283035b7f221dcef0cd5d1e488da3af12b6.tar.gz
chocolate-doom-63df9283035b7f221dcef0cd5d1e488da3af12b6.tar.bz2
chocolate-doom-63df9283035b7f221dcef0cd5d1e488da3af12b6.zip
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).
Diffstat (limited to 'src/doom/d_main.c')
-rw-r--r--src/doom/d_main.c7
1 files changed, 6 insertions, 1 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,