aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-14 21:31:20 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-14 21:31:20 +0000
commitb5059bc8a48496f5650a03d18980014b552831eb (patch)
tree267875960b7472f32da752bab90ca20d04c9f001
parent05fe69eb922ef5cc301a91874fa5b4dbcc7b02dc (diff)
downloadrtmux-b5059bc8a48496f5650a03d18980014b552831eb.tar.gz
rtmux-b5059bc8a48496f5650a03d18980014b552831eb.tar.bz2
rtmux-b5059bc8a48496f5650a03d18980014b552831eb.zip
Sync OpenBSD patchset 251:
If the client passes zero for the window size in the identify message (which it can, for example on serial terminals), reset it to 80x25, same as for resize messages. Problem reported by kettenis@.
-rw-r--r--server-msg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/server-msg.c b/server-msg.c
index 2499140b..e5f7a20e 100644
--- a/server-msg.c
+++ b/server-msg.c
@@ -1,4 +1,4 @@
-/* $Id: server-msg.c,v 1.80 2009-08-14 21:23:20 tcunha Exp $ */
+/* $Id: server-msg.c,v 1.81 2009-08-14 21:31:20 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -238,7 +238,11 @@ void
server_msg_identify(struct client *c, struct msg_identify_data *data, int fd)
{
c->tty.sx = data->sx;
+ if (c->tty.sx == 0)
+ c->tty.sx = 80;
c->tty.sy = data->sy;
+ if (c->tty.sy == 0)
+ c->tty.sy = 25;
c->cwd = NULL;
data->cwd[(sizeof data->cwd) - 1] = '\0';