From b9253ef24e70f7a7bbfe320b1c3639da52d740f0 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Wed, 3 Mar 2010 11:55:39 -0500 Subject: Do not terminate when size is reduced too much. Height of a window can be negative, when both hardstatus and caption are turned on, and the terminal size is reduced to one-line height. So handle those cases more gracefully. Fixes savannah bug #29037. --- src/ansi.c | 2 +- src/resize.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ansi.c b/src/ansi.c index d15867b..f9e0cc8 100644 --- a/src/ansi.c +++ b/src/ansi.c @@ -322,7 +322,7 @@ register int len; curr->w_monitor = MON_FOUND; } - if (cols && rows) + if (cols > 0 && rows > 0) { do { diff --git a/src/resize.c b/src/resize.c index 553b0ed..39f6e28 100644 --- a/src/resize.c +++ b/src/resize.c @@ -628,8 +628,8 @@ int wi, he, hi; int ncx, ncy, naka, t; int y, shift; - if (wi == 0) - he = hi = 0; + if (wi <= 0 || he <= 0) + wi = he = hi = 0; if (p->w_type == W_TYPE_GROUP) return 0; -- cgit v1.2.1