Prepare TERM in buffer before sending; this allows size to be part of cmd and prevents it being split. This is the only place this happens so remove it from todo.

This commit is contained in:
Nicholas Marriott
2008-06-01 21:24:33 +00:00
parent 693231e8eb
commit 11ee55e755
2 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $Id: client.c,v 1.26 2008-05-31 20:04:15 nicm Exp $ */
/* $Id: client.c,v 1.27 2008-06-01 21:24:33 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -44,6 +44,7 @@ client_init(const char *path, struct client_ctx *cctx, int start_server)
size_t size;
int mode;
u_int retries;
struct buffer *b;
retries = 0;
retry:
@ -99,8 +100,12 @@ retry:
data.sy = ws.ws_row;
if (ttyname_r(STDIN_FILENO, data.tty, sizeof data.tty) != 0)
fatal("ttyname_r failed");
client_write_server(cctx, MSG_IDENTIFY, &data, sizeof data);
cmd_send_string(cctx->srv_out, getenv("TERM"));
b = buffer_create(BUFSIZ);
cmd_send_string(b, getenv("TERM"));
client_write_server2(cctx, MSG_IDENTIFY,
&data, sizeof data, BUFFER_OUT(b), BUFFER_USED(b));
buffer_destroy(b);
}
return (0);