projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanups from yesterday's destabilisation: lots of stuff in
[u/mdw/putty]
/
telnet.c
diff --git
a/telnet.c
b/telnet.c
index
9aba9ea
..
b8ce417
100644
(file)
--- a/
telnet.c
+++ b/
telnet.c
@@
-3,7
+3,6
@@
#include <stdlib.h>
#include "putty.h"
#include <stdlib.h>
#include "putty.h"
-#include "terminal.h"
#ifndef FALSE
#define FALSE 0
#ifndef FALSE
#define FALSE 0
@@
-15,6
+14,7
@@
static Socket s = NULL;
static void *frontend;
static Socket s = NULL;
static void *frontend;
+static int telnet_term_width, telnet_term_height;
#define IAC 255 /* interpret as command: */
#define DONT 254 /* you are not to use option */
#define IAC 255 /* interpret as command: */
#define DONT 254 /* you are not to use option */
@@
-618,6
+618,8
@@
static char *telnet_init(void *frontend_handle,
char *err;
frontend = frontend_handle;
char *err;
frontend = frontend_handle;
+ telnet_term_width = cfg.width;
+ telnet_term_height = cfg.height;
/*
* Try to find host.
/*
* Try to find host.
@@
-719,20
+721,23
@@
static int telnet_sendbuffer(void)
/*
* Called to set the size of the window from Telnet's POV.
*/
/*
* Called to set the size of the window from Telnet's POV.
*/
-static void telnet_size(
void
)
+static void telnet_size(
int width, int height
)
{
unsigned char b[16];
char logbuf[50];
{
unsigned char b[16];
char logbuf[50];
- if (s == NULL || term == NULL || o_naws.state != ACTIVE)
+ telnet_term_width = width;
+ telnet_term_height = height;
+
+ if (s == NULL || o_naws.state != ACTIVE)
return;
b[0] = IAC;
b[1] = SB;
b[2] = TELOPT_NAWS;
return;
b[0] = IAC;
b[1] = SB;
b[2] = TELOPT_NAWS;
- b[3] = te
rm->cols
>> 8;
- b[4] = te
rm->cols
& 0xFF;
- b[5] = te
rm->rows
>> 8;
- b[6] = te
rm->rows
& 0xFF;
+ b[3] = te
lnet_term_width
>> 8;
+ b[4] = te
lnet_term_width
& 0xFF;
+ b[5] = te
lnet_term_height
>> 8;
+ b[6] = te
lnet_term_height
& 0xFF;
b[7] = IAC;
b[8] = SE;
telnet_bufsize = sk_write(s, b, 9);
b[7] = IAC;
b[8] = SE;
telnet_bufsize = sk_write(s, b, 9);