=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/server-msg.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/tmux/Attic/server-msg.c 2009/09/15 07:45:16 1.17 --- src/usr.bin/tmux/Attic/server-msg.c 2009/09/23 06:05:02 1.18 *************** *** 1,4 **** ! /* $OpenBSD: server-msg.c,v 1.17 2009/09/15 07:45:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server-msg.c,v 1.18 2009/09/23 06:05:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 74,79 **** --- 74,81 ---- case MSG_IDENTIFY: if (datalen != sizeof identifydata) fatalx("bad MSG_IDENTIFY size"); + if (imsg.fd == -1) + fatalx("MSG_IDENTIFY missing fd"); memcpy(&identifydata, imsg.data, sizeof identifydata); server_msg_identify(c, &identifydata, imsg.fd); *************** *** 243,263 **** 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 = 24; - c->cwd = NULL; data->cwd[(sizeof data->cwd) - 1] = '\0'; if (*data->cwd != '\0') c->cwd = xstrdup(data->cwd); - data->tty[(sizeof data->tty) - 1] = '\0'; data->term[(sizeof data->term) - 1] = '\0'; ! tty_init(&c->tty, fd, data->tty, data->term); if (data->flags & IDENTIFY_UTF8) c->tty.flags |= TTY_UTF8; if (data->flags & IDENTIFY_256COLOURS) --- 245,257 ---- void server_msg_identify(struct client *c, struct msg_identify_data *data, int fd) { c->cwd = NULL; data->cwd[(sizeof data->cwd) - 1] = '\0'; if (*data->cwd != '\0') c->cwd = xstrdup(data->cwd); data->term[(sizeof data->term) - 1] = '\0'; ! tty_init(&c->tty, fd, data->term); if (data->flags & IDENTIFY_UTF8) c->tty.flags |= TTY_UTF8; if (data->flags & IDENTIFY_256COLOURS) *************** *** 266,271 **** --- 260,272 ---- c->tty.term_flags |= TERM_88COLOURS; if (data->flags & IDENTIFY_HASDEFAULTS) c->tty.term_flags |= TERM_HASDEFAULTS; + + 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 = 24; c->flags |= CLIENT_TERMINAL; }