[console] Check for curses before calling updaters

If curses isn't being used, then there are no entities and thus no
components to run. Fixes a segfault when running a server without curses
enabled.
This commit is contained in:
Bill Currie 2022-11-12 14:37:42 +09:00
parent 0ea5c1fa14
commit bbd2cdb8c8
1 changed files with 8 additions and 2 deletions

View File

@ -146,7 +146,11 @@ enum {
sv_cursor = 8,
};
#ifdef HAVE_NCURSES
static int use_curses = 1;
#else
static int use_curses = 0;
#endif
static view_t sv_view;
static view_t output;
@ -840,8 +844,10 @@ C_DrawConsole (void)
{
// only the status bar is drawn because the inputline and output views
// take care of themselves
if (use_curses) {
draw_status (status);
sv_refresh_windows ();
}
}
static void