From f22b3269193b0ba5491750245c1793ac20a11308 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sun, 3 Jul 2022 05:23:40 +0300 Subject: [PATCH] Cmd_Exec_f: no need to Hunk_FreeToLowMark if using embedded default.cfg --- Quake/cmd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Quake/cmd.c b/Quake/cmd.c index 3758243e..4caa8f97 100644 --- a/Quake/cmd.c +++ b/Quake/cmd.c @@ -271,7 +271,9 @@ void Cmd_Exec_f (void) mark = Hunk_LowMark (); f = (char *)COM_LoadHunkFile (Cmd_Argv(1), NULL); - if (!f && !strcmp(Cmd_Argv(1), "default.cfg")) { + if (!f && !strcmp(Cmd_Argv(1), "default.cfg")) + { + mark = -1; f = default_cfg; /* see above.. */ } if (!f) @@ -279,9 +281,11 @@ void Cmd_Exec_f (void) Con_Printf ("couldn't exec %s\n",Cmd_Argv(1)); return; } - Con_Printf ("execing %s\n",Cmd_Argv(1)); + Con_Printf ("execing %s\n",Cmd_Argv(1)); Cbuf_InsertText (f); + + if (mark < 0) return; Hunk_FreeToLowMark (mark); }