diff --git a/curses.h b/curses.h index a9a21007..e53189e9 100644 --- a/curses.h +++ b/curses.h @@ -418,8 +418,8 @@ typedef struct on last key press */ bool return_key_modifiers; /* TRUE if modifier keys are returned as "real" keys */ - bool unused_key_code; /* (was) TRUE if last key is a special key; - used internally by get_wch() */ + bool in_endwin; /* if we're in endwin(), we should use + only signal-safe code */ MOUSE_STATUS mouse_status; /* last returned mouse status */ short line_color; /* color of line attributes - default -1 */ attr_t termattrs; /* attribute capabilities */ diff --git a/pdcurses/debug.c b/pdcurses/debug.c index ad5134a3..ffec691a 100644 --- a/pdcurses/debug.c +++ b/pdcurses/debug.c @@ -71,7 +71,7 @@ void PDC_debug(const char *fmt, ...) time_t now; assert( SP); - if (!SP || !SP->dbfp) + if (!SP || !SP->dbfp || SP->in_endwin) return; time(&now); diff --git a/pdcurses/initscr.c b/pdcurses/initscr.c index 1acf8d18..75f325b9 100644 --- a/pdcurses/initscr.c +++ b/pdcurses/initscr.c @@ -310,6 +310,7 @@ WINDOW *Xinitscr(int argc, char **argv) int endwin(void) { + SP->in_endwin = TRUE; PDC_LOG(("endwin() - called\n")); /* Allow temporary exit from curses using endwin() */ @@ -320,6 +321,7 @@ int endwin(void) assert( SP); SP->alive = FALSE; + SP->in_endwin = FALSE; return OK; }