mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
John Sullivan's patches plus more fixes:
- Stop using the identifier `environ' as some platforms make it a macro - Fix silly error box at end of connection in FWHACK mode - Fix GPF on maximise-then-restore - Use SetCapture to allow drag-selecting outside the window - Correctly update window title when iconic and in win_name_always mode [originally from svn r12]
This commit is contained in:
parent
c74130d423
commit
60ab6a5d82
2
putty.h
2
putty.h
@ -98,7 +98,7 @@ typedef struct {
|
|||||||
/* Telnet options */
|
/* Telnet options */
|
||||||
char termtype[32];
|
char termtype[32];
|
||||||
char termspeed[32];
|
char termspeed[32];
|
||||||
char environ[1024]; /* VAR\tvalue\0VAR\tvalue\0\0 */
|
char environmt[1024]; /* VAR\tvalue\0VAR\tvalue\0\0 */
|
||||||
char username[32];
|
char username[32];
|
||||||
int rfc_environ;
|
int rfc_environ;
|
||||||
/* Keyboard options */
|
/* Keyboard options */
|
||||||
|
6
ssh.c
6
ssh.c
@ -114,6 +114,12 @@ static void ssh_gotdata(unsigned char *data, int datalen) {
|
|||||||
data++, datalen--;
|
data++, datalen--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef FWHACK
|
||||||
|
if (len == 0x52656d6f) { /* "Remo"te server has closed ... */
|
||||||
|
len = 0x300; /* big enough to carry to end */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
pad = 8 - (len%8);
|
pad = 8 - (len%8);
|
||||||
|
|
||||||
biglen = len + pad;
|
biglen = len + pad;
|
||||||
|
2
ssh.h
2
ssh.h
@ -1,3 +1,5 @@
|
|||||||
|
#include <string.h>
|
||||||
|
|
||||||
struct RSAKey {
|
struct RSAKey {
|
||||||
int bits;
|
int bits;
|
||||||
int bytes;
|
int bytes;
|
||||||
|
22
sshdes.c
22
sshdes.c
@ -17,10 +17,15 @@ information.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: sshdes.c,v 1.1 1999/01/08 13:02:12 simon Exp $
|
* $Id: sshdes.c,v 1.2 1999/01/08 13:10:15 simon Exp $
|
||||||
* $Log: sshdes.c,v $
|
* $Log: sshdes.c,v $
|
||||||
* Revision 1.1 1999/01/08 13:02:12 simon
|
* Revision 1.2 1999/01/08 13:10:15 simon
|
||||||
* Initial checkin: beta 0.43
|
* John Sullivan's patches plus more fixes:
|
||||||
|
* - Stop using the identifier `environ' as some platforms make it a macro
|
||||||
|
* - Fix silly error box at end of connection in FWHACK mode
|
||||||
|
* - Fix GPF on maximise-then-restore
|
||||||
|
* - Use SetCapture to allow drag-selecting outside the window
|
||||||
|
* - Correctly update window title when iconic and in win_name_always mode
|
||||||
*
|
*
|
||||||
* Revision 1.1.1.1 1996/02/18 21:38:11 ylo
|
* Revision 1.1.1.1 1996/02/18 21:38:11 ylo
|
||||||
* Imported ssh-1.2.13.
|
* Imported ssh-1.2.13.
|
||||||
@ -111,10 +116,15 @@ cryptography and data security, including the following:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: sshdes.c,v 1.1 1999/01/08 13:02:12 simon Exp $
|
* $Id: sshdes.c,v 1.2 1999/01/08 13:10:15 simon Exp $
|
||||||
* $Log: sshdes.c,v $
|
* $Log: sshdes.c,v $
|
||||||
* Revision 1.1 1999/01/08 13:02:12 simon
|
* Revision 1.2 1999/01/08 13:10:15 simon
|
||||||
* Initial checkin: beta 0.43
|
* John Sullivan's patches plus more fixes:
|
||||||
|
* - Stop using the identifier `environ' as some platforms make it a macro
|
||||||
|
* - Fix silly error box at end of connection in FWHACK mode
|
||||||
|
* - Fix GPF on maximise-then-restore
|
||||||
|
* - Use SetCapture to allow drag-selecting outside the window
|
||||||
|
* - Correctly update window title when iconic and in win_name_always mode
|
||||||
*
|
*
|
||||||
* Revision 1.1.1.1 1996/02/18 21:38:11 ylo
|
* Revision 1.1.1.1 1996/02/18 21:38:11 ylo
|
||||||
* Imported ssh-1.2.13.
|
* Imported ssh-1.2.13.
|
||||||
|
2
telnet.c
2
telnet.c
@ -350,7 +350,7 @@ static void process_subneg (void) {
|
|||||||
b[0] = IAC; b[1] = SB; b[2] = sb_opt;
|
b[0] = IAC; b[1] = SB; b[2] = sb_opt;
|
||||||
b[3] = TELQUAL_IS;
|
b[3] = TELQUAL_IS;
|
||||||
n = 4;
|
n = 4;
|
||||||
e = cfg.environ;
|
e = cfg.environmt;
|
||||||
while (*e) {
|
while (*e) {
|
||||||
b[n++] = var;
|
b[n++] = var;
|
||||||
while (*e && *e != '\t') b[n++] = *e++;
|
while (*e && *e != '\t') b[n++] = *e++;
|
||||||
|
13
terminal.c
13
terminal.c
@ -1254,8 +1254,8 @@ void term_paint (Context ctx, int l, int t, int r, int b) {
|
|||||||
right = (r - 1) / font_width;
|
right = (r - 1) / font_width;
|
||||||
top = t / font_height;
|
top = t / font_height;
|
||||||
bottom = (b - 1) / font_height;
|
bottom = (b - 1) / font_height;
|
||||||
for (i = top; i <= bottom; i++)
|
for (i = top; i <= bottom && j<rows ; i++)
|
||||||
for (j = left; j <= right; j++)
|
for (j = left; j <= right && j<cols ; j++)
|
||||||
disptext[i*(cols+1)+j] = ATTR_INVALID;
|
disptext[i*(cols+1)+j] = ATTR_INVALID;
|
||||||
|
|
||||||
do_paint (ctx, FALSE);
|
do_paint (ctx, FALSE);
|
||||||
@ -1339,7 +1339,14 @@ static void sel_spread (void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void term_mouse (Mouse_Button b, Mouse_Action a, int x, int y) {
|
void term_mouse (Mouse_Button b, Mouse_Action a, int x, int y) {
|
||||||
unsigned long *selpoint = disptop + y * (cols+1) + x;
|
unsigned long *selpoint;
|
||||||
|
|
||||||
|
if (y<0) y = 0;
|
||||||
|
if (y>=rows) y = rows-1;
|
||||||
|
if (x<0) x = 0;
|
||||||
|
if (x>=cols) x = cols-1;
|
||||||
|
|
||||||
|
selpoint = disptop + y * (cols+1) + x;
|
||||||
|
|
||||||
if (b == MB_SELECT && a == MA_CLICK) {
|
if (b == MB_SELECT && a == MA_CLICK) {
|
||||||
deselect();
|
deselect();
|
||||||
|
18
windlg.c
18
windlg.c
@ -134,9 +134,9 @@ static void save_settings (char *section, int do_host) {
|
|||||||
wpps (sesskey, "TerminalType", cfg.termtype);
|
wpps (sesskey, "TerminalType", cfg.termtype);
|
||||||
wpps (sesskey, "TerminalSpeed", cfg.termspeed);
|
wpps (sesskey, "TerminalSpeed", cfg.termspeed);
|
||||||
{
|
{
|
||||||
char buf[2*sizeof(cfg.environ)], *p, *q;
|
char buf[2*sizeof(cfg.environmt)], *p, *q;
|
||||||
p = buf;
|
p = buf;
|
||||||
q = cfg.environ;
|
q = cfg.environmt;
|
||||||
while (*q) {
|
while (*q) {
|
||||||
while (*q) {
|
while (*q) {
|
||||||
int c = *q++;
|
int c = *q++;
|
||||||
@ -245,10 +245,10 @@ static void load_settings (char *section, int do_host) {
|
|||||||
gpps (sesskey, "TerminalSpeed", "38400,38400", cfg.termspeed,
|
gpps (sesskey, "TerminalSpeed", "38400,38400", cfg.termspeed,
|
||||||
sizeof(cfg.termspeed));
|
sizeof(cfg.termspeed));
|
||||||
{
|
{
|
||||||
char buf[2*sizeof(cfg.environ)], *p, *q;
|
char buf[2*sizeof(cfg.environmt)], *p, *q;
|
||||||
gpps (sesskey, "Environment", "", buf, sizeof(buf));
|
gpps (sesskey, "Environment", "", buf, sizeof(buf));
|
||||||
p = buf;
|
p = buf;
|
||||||
q = cfg.environ;
|
q = cfg.environmt;
|
||||||
while (*p) {
|
while (*p) {
|
||||||
while (*p && *p != ',') {
|
while (*p && *p != ',') {
|
||||||
int c = *p++;
|
int c = *p++;
|
||||||
@ -712,7 +712,7 @@ static int CALLBACK TelnetProc (HWND hwnd, UINT msg,
|
|||||||
SetDlgItemText (hwnd, IDC3_TSEDIT, cfg.termspeed);
|
SetDlgItemText (hwnd, IDC3_TSEDIT, cfg.termspeed);
|
||||||
SetDlgItemText (hwnd, IDC3_LOGEDIT, cfg.username);
|
SetDlgItemText (hwnd, IDC3_LOGEDIT, cfg.username);
|
||||||
{
|
{
|
||||||
char *p = cfg.environ;
|
char *p = cfg.environmt;
|
||||||
while (*p) {
|
while (*p) {
|
||||||
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_ADDSTRING, 0,
|
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_ADDSTRING, 0,
|
||||||
(LPARAM) p);
|
(LPARAM) p);
|
||||||
@ -746,7 +746,7 @@ static int CALLBACK TelnetProc (HWND hwnd, UINT msg,
|
|||||||
case IDC3_ENVADD:
|
case IDC3_ENVADD:
|
||||||
if (HIWORD(wParam) == BN_CLICKED ||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
HIWORD(wParam) == BN_DOUBLECLICKED) {
|
HIWORD(wParam) == BN_DOUBLECLICKED) {
|
||||||
char str[sizeof(cfg.environ)];
|
char str[sizeof(cfg.environmt)];
|
||||||
char *p;
|
char *p;
|
||||||
GetDlgItemText (hwnd, IDC3_VAREDIT, str, sizeof(str)-1);
|
GetDlgItemText (hwnd, IDC3_VAREDIT, str, sizeof(str)-1);
|
||||||
if (!*str) {
|
if (!*str) {
|
||||||
@ -760,12 +760,12 @@ static int CALLBACK TelnetProc (HWND hwnd, UINT msg,
|
|||||||
MessageBeep(0);
|
MessageBeep(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
p = cfg.environ;
|
p = cfg.environmt;
|
||||||
while (*p) {
|
while (*p) {
|
||||||
while (*p) p++;
|
while (*p) p++;
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
if ((p-cfg.environ) + strlen(str) + 2 < sizeof(cfg.environ)) {
|
if ((p-cfg.environmt) + strlen(str) + 2 < sizeof(cfg.environmt)) {
|
||||||
strcpy (p, str);
|
strcpy (p, str);
|
||||||
p[strlen(str)+1] = '\0';
|
p[strlen(str)+1] = '\0';
|
||||||
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_ADDSTRING,
|
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_ADDSTRING,
|
||||||
@ -790,7 +790,7 @@ static int CALLBACK TelnetProc (HWND hwnd, UINT msg,
|
|||||||
|
|
||||||
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_DELETESTRING,
|
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_DELETESTRING,
|
||||||
i, 0);
|
i, 0);
|
||||||
p = cfg.environ;
|
p = cfg.environmt;
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
if (!*p)
|
if (!*p)
|
||||||
goto disaster;
|
goto disaster;
|
||||||
|
42
window.c
42
window.c
@ -698,33 +698,43 @@ static int WINAPI WndProc (HWND hwnd, UINT message,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#define X_POS(l) ((int)(short)LOWORD(l))
|
||||||
|
#define Y_POS(l) ((int)(short)HIWORD(l))
|
||||||
|
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
click (MB_SELECT, LOWORD(lParam) / font_width,
|
SetCapture(hwnd);
|
||||||
HIWORD(lParam) / font_height);
|
click (MB_SELECT, X_POS(lParam) / font_width,
|
||||||
|
Y_POS(lParam) / font_height);
|
||||||
return 0;
|
return 0;
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
term_mouse (MB_SELECT, MA_RELEASE, LOWORD(lParam) / font_width,
|
term_mouse (MB_SELECT, MA_RELEASE, X_POS(lParam) / font_width,
|
||||||
HIWORD(lParam) / font_height);
|
Y_POS(lParam) / font_height);
|
||||||
|
ReleaseCapture();
|
||||||
return 0;
|
return 0;
|
||||||
case WM_MBUTTONDOWN:
|
case WM_MBUTTONDOWN:
|
||||||
|
SetCapture(hwnd);
|
||||||
click (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
|
click (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
|
||||||
LOWORD(lParam) / font_width,
|
X_POS(lParam) / font_width,
|
||||||
HIWORD(lParam) / font_height);
|
Y_POS(lParam) / font_height);
|
||||||
return 0;
|
return 0;
|
||||||
case WM_MBUTTONUP:
|
case WM_MBUTTONUP:
|
||||||
term_mouse (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
|
term_mouse (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
|
||||||
MA_RELEASE, LOWORD(lParam) / font_width,
|
MA_RELEASE, X_POS(lParam) / font_width,
|
||||||
HIWORD(lParam) / font_height);
|
Y_POS(lParam) / font_height);
|
||||||
return 0;
|
return 0;
|
||||||
|
ReleaseCapture();
|
||||||
case WM_RBUTTONDOWN:
|
case WM_RBUTTONDOWN:
|
||||||
|
SetCapture(hwnd);
|
||||||
click (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
|
click (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
|
||||||
LOWORD(lParam) / font_width,
|
X_POS(lParam) / font_width,
|
||||||
HIWORD(lParam) / font_height);
|
Y_POS(lParam) / font_height);
|
||||||
return 0;
|
return 0;
|
||||||
case WM_RBUTTONUP:
|
case WM_RBUTTONUP:
|
||||||
term_mouse (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
|
term_mouse (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
|
||||||
MA_RELEASE, LOWORD(lParam) / font_width,
|
MA_RELEASE, X_POS(lParam) / font_width,
|
||||||
HIWORD(lParam) / font_height);
|
Y_POS(lParam) / font_height);
|
||||||
|
ReleaseCapture();
|
||||||
return 0;
|
return 0;
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
/*
|
/*
|
||||||
@ -742,8 +752,8 @@ static int WINAPI WndProc (HWND hwnd, UINT message,
|
|||||||
b = cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND;
|
b = cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND;
|
||||||
else
|
else
|
||||||
b = cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE;
|
b = cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE;
|
||||||
term_mouse (b, MA_DRAG, LOWORD(lParam) / font_width,
|
term_mouse (b, MA_DRAG, X_POS(lParam) / font_width,
|
||||||
HIWORD(lParam) / font_height);
|
Y_POS(lParam) / font_height);
|
||||||
}
|
}
|
||||||
lastbtn = MB_NOTHING;
|
lastbtn = MB_NOTHING;
|
||||||
lastact = MA_NOTHING;
|
lastact = MA_NOTHING;
|
||||||
@ -1315,7 +1325,7 @@ void set_title (char *title) {
|
|||||||
sfree (window_name);
|
sfree (window_name);
|
||||||
window_name = smalloc(1+strlen(title));
|
window_name = smalloc(1+strlen(title));
|
||||||
strcpy (window_name, title);
|
strcpy (window_name, title);
|
||||||
if (!IsIconic(hwnd))
|
if (cfg.win_name_always || !IsIconic(hwnd))
|
||||||
SetWindowText (hwnd, title);
|
SetWindowText (hwnd, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1323,7 +1333,7 @@ void set_icon (char *title) {
|
|||||||
sfree (icon_name);
|
sfree (icon_name);
|
||||||
icon_name = smalloc(1+strlen(title));
|
icon_name = smalloc(1+strlen(title));
|
||||||
strcpy (icon_name, title);
|
strcpy (icon_name, title);
|
||||||
if (IsIconic(hwnd))
|
if (!cfg.win_name_always && IsIconic(hwnd))
|
||||||
SetWindowText (hwnd, title);
|
SetWindowText (hwnd, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user