]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cmd.c
add a newline at the end of each exec'd config file
[xonotic/darkplaces.git] / cmd.c
diff --git a/cmd.c b/cmd.c
index 504a88d5a2bc30ecca50a0fe4053a3ffb073b850..a911fb346fd6de24a57f7af1912593cffa637ce3 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -287,6 +287,9 @@ static void Cmd_Exec_f (void)
        if (!strcmp(Cmd_Argv(1), "default.cfg"))
                Cbuf_InsertText("\ncvar_lockdefaults\n");
 
+       // insert newline after the text to make sure the last line is terminated (some text editors omit the trailing newline)
+       // (note: insertion order here is backwards from execution order, so this adds it after the text, by calling it before...)
+       Cbuf_InsertText ("\n");
        Cbuf_InsertText (f);
        Mem_Free(f);
 }