Make the console line-bufered. woot.

This commit is contained in:
Adam Olsen 2001-08-09 12:19:15 +00:00
parent 0c63c11b4b
commit 4cd037f025
2 changed files with 7 additions and 2 deletions

View file

@ -33,6 +33,7 @@
# include "config.h" # include "config.h"
#endif #endif
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h>
#include "QF/console.h" #include "QF/console.h"
#include "QF/cvar.h" #include "QF/cvar.h"
@ -44,9 +45,10 @@ void
Con_Init (const char *plugin_name) Con_Init (const char *plugin_name)
{ {
con_module = PI_LoadPlugin ("console", plugin_name); con_module = PI_LoadPlugin ("console", plugin_name);
if (con_module) { if (con_module)
con_module->functions->general->p_Init (); con_module->functions->general->p_Init ();
} else
setvbuf (stdout, 0, _IOLBF, BUFSIZ);
} }
void void

View file

@ -141,6 +141,9 @@ Con_Init (const char *plugin_name)
wrefresh (output); wrefresh (output);
wrefresh (status); wrefresh (status);
wrefresh (input); wrefresh (input);
#else
if (setvbuf (stdout, 0, _IONBF, BUFSIZ))
Con_Printf ("warning: couldn't set stdout to linebuffered.\n");
#endif #endif
} }