summaryrefslogtreecommitdiff
path: root/src/doom/d_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/doom/d_main.c')
-rw-r--r--src/doom/d_main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index ca722dc6..bcdfcaa3 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -1151,6 +1151,11 @@ static void LoadIwadDeh(void)
}
}
+static void G_CheckDemoStatusAtExit (void)
+{
+ G_CheckDemoStatus();
+}
+
//
// D_DoomMain
//
@@ -1470,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));
}
@@ -1481,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,
@@ -1498,7 +1508,7 @@ void D_DoomMain (void)
printf("Playing demo %s.\n", file);
}
- I_AtExit((atexit_func_t) G_CheckDemoStatus, true);
+ I_AtExit(G_CheckDemoStatusAtExit, true);
// Generate the WAD hash table. Speed things up a bit.
W_GenerateHashTable();