X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/887035a593c8c0a1af853657c80046e17dc5581a..f8255dcefee839825ac584a96dee34d03bc69677:/rlogin.c diff --git a/rlogin.c b/rlogin.c index 4baada73..74e8268b 100644 --- a/rlogin.c +++ b/rlogin.c @@ -4,7 +4,6 @@ #include #include "putty.h" -#include "terminal.h" #ifndef FALSE #define FALSE 0 @@ -17,9 +16,10 @@ static Socket s = NULL; static int rlogin_bufsize; +static int rlogin_term_width, rlogin_term_height; static void *frontend; -static void rlogin_size(void); +static void rlogin_size(int width, int height); static void c_write(char *buf, int len) { @@ -50,7 +50,7 @@ static int rlogin_receive(Plug plug, int urgent, char *data, int len) c = *data++; len--; if (c == '\x80') - rlogin_size(); + rlogin_size(rlogin_term_width, rlogin_term_height); /* * We should flush everything (aka Telnet SYNCH) if we see * 0x02, and we should turn off and on _local_ flow control @@ -103,6 +103,8 @@ static char *rlogin_init(void *frontend_handle, char *err; frontend = frontend_handle; + rlogin_term_width = cfg.width; + rlogin_term_height = cfg.height; /* * Try to find host. @@ -180,17 +182,20 @@ static int rlogin_sendbuffer(void) /* * Called to set the size of the window */ -static void rlogin_size(void) +static void rlogin_size(int width, int height) { char b[12] = { '\xFF', '\xFF', 0x73, 0x73, 0, 0, 0, 0, 0, 0, 0, 0 }; - if (s == NULL || term == NULL) + rlogin_term_width = width; + rlogin_term_height = height; + + if (s == NULL) return; - - b[6] = term->cols >> 8; - b[7] = term->cols & 0xFF; - b[4] = term->rows >> 8; - b[5] = term->rows & 0xFF; + + b[6] = rlogin_term_width >> 8; + b[7] = rlogin_term_width & 0xFF; + b[4] = rlogin_term_height >> 8; + b[5] = rlogin_term_height & 0xFF; rlogin_bufsize = sk_write(s, b, 12); return; }