From 386a8e50597551ac66735b6651216433addd5652 Mon Sep 17 00:00:00 2001 From: dsl Date: Wed, 28 May 2003 20:19:42 +0000 Subject: [PATCH] Don't restartwin() if it isn't stopped. Ensures we don't save the modified tty flags (as well as doing all the initialisation twice) if the application (eg systat) calls curses functions in its own restart code. --- lib/libcurses/tstp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/libcurses/tstp.c b/lib/libcurses/tstp.c index 83290b06a49a..f1bb8d91865f 100644 --- a/lib/libcurses/tstp.c +++ b/lib/libcurses/tstp.c @@ -1,4 +1,4 @@ -/* $NetBSD: tstp.c,v 1.27 2003/05/18 10:02:07 dsl Exp $ */ +/* $NetBSD: tstp.c,v 1.28 2003/05/28 20:19:42 dsl Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)tstp.c 8.3 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: tstp.c,v 1.27 2003/05/18 10:02:07 dsl Exp $"); +__RCSID("$NetBSD: tstp.c,v 1.28 2003/05/28 20:19:42 dsl Exp $"); #endif #endif /* not lint */ @@ -154,6 +154,9 @@ __stopwin(void) void __restartwin(void) { + if (!_cursesi_screen->endwin) + return; + /* Reset the curses SIGTSTP signal handler. */ __set_stophandler();