]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
Merge PR 'Curl improvements'
[xonotic/darkplaces.git] / console.c
index e7e810e63eb6169b9f85cbcc5974deb8fc8609a7..cd596418592a0b00fef50a234173c7b65a1bc8b5 100644 (file)
--- a/console.c
+++ b/console.c
@@ -524,14 +524,16 @@ Log_Close
 */
 void Log_Close (void)
 {
-       if (logfile == NULL)
-               return;
+       qfile_t* l = logfile;
 
-       FS_Print (logfile, Log_Timestamp ("Log stopped"));
-       FS_Print (logfile, "\n");
-       FS_Close (logfile);
+       if (l == NULL)
+               return;
 
+       FS_Print (l, Log_Timestamp ("Log stopped"));
+       FS_Print (l, "\n");
        logfile = NULL;
+       FS_Close (l);
+
        crt_log_file[0] = '\0';
 }
 
@@ -931,9 +933,7 @@ void Con_Init (void)
        Cmd_AddCommand(CF_SHARED, "condump", Con_ConDump_f, "output console history to a file (see also log_file)");
 
        con_initialized = true;
-       // initialize console window (only used by sys_win.c)
-       Sys_InitConsole();
-       
+
        Con_Print("Console initialized.\n");
 }
 
@@ -1361,11 +1361,11 @@ void Con_MaskPrint(int additionalmask, const char *msg)
                                                *out++ = 'm';
                                        }
                                        *out++ = 0;
-                                       Sys_PrintToTerminal(printline);
+                                       Sys_Print(printline);
                                }
                                else if(sys_colortranslation.integer == 2) // Quake
                                {
-                                       Sys_PrintToTerminal(line);
+                                       Sys_Print(line);
                                }
                                else // strip
                                {
@@ -1416,7 +1416,7 @@ void Con_MaskPrint(int additionalmask, const char *msg)
                                                }
                                        }
                                        *out++ = 0;
-                                       Sys_PrintToTerminal(printline);
+                                       Sys_Print(printline);
                                }
                        }
                        // empty the line buffer
@@ -1667,7 +1667,7 @@ static float Con_WordWidthFunc(void *passthrough, const char *w, size_t *length,
                return DrawQ_TextWidth(w, *length, ti->fontsize, ti->fontsize, false, ti->font);
        else
        {
-               Sys_PrintfToTerminal("Con_WordWidthFunc: can't get here (maxWidth should never be %f)\n", maxWidth);
+               Sys_Printf("Con_WordWidthFunc: can't get here (maxWidth should never be %f)\n", maxWidth);
                // Note: this is NOT a Con_Printf, as it could print recursively
                return 0;
        }