summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-03-03 11:55:39 -0500
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-03-03 11:55:39 -0500
commitb9253ef24e70f7a7bbfe320b1c3639da52d740f0 (patch)
tree92992f3e6a0b6f6612c69a0e4b3def5e719e0bf7
parentda8e87d6505fb33ed131144a33af88c6d0dc96fd (diff)
downloadscreen-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.c2
-rw-r--r--src/resize.c4
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;