diff options
author | Sadrul Habib Chowdhury <sadrul@users.sourceforge.net> | 2010-03-03 11:55:39 -0500 |
---|---|---|
committer | Sadrul Habib Chowdhury <sadrul@users.sourceforge.net> | 2010-03-03 11:55:39 -0500 |
commit | b9253ef24e70f7a7bbfe320b1c3639da52d740f0 (patch) | |
tree | 92992f3e6a0b6f6612c69a0e4b3def5e719e0bf7 | |
parent | da8e87d6505fb33ed131144a33af88c6d0dc96fd (diff) | |
download | screen-b9253ef24e70f7a7bbfe320b1c3639da52d740f0.tar.gz |
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.
-rw-r--r-- | src/ansi.c | 2 | ||||
-rw-r--r-- | src/resize.c | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -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; |