- 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
git-svn-id: svn://svn.tartarus.org/sgt/putty@12
cda61777-01e9-0310-a592-
d414129be87e
/* Telnet options */
char termtype[32];
char termspeed[32];
/* Telnet options */
char termtype[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];
int rfc_environ;
/* Keyboard options */
char username[32];
int rfc_environ;
/* Keyboard options */
+#ifdef FWHACK
+ if (len == 0x52656d6f) { /* "Remo"te server has closed ... */
+ len = 0x300; /* big enough to carry to end */
+ }
+#endif
+
pad = 8 - (len%8);
biglen = len + pad;
pad = 8 - (len%8);
biglen = len + pad;
struct RSAKey {
int bits;
int bytes;
struct RSAKey {
int bits;
int bytes;
- * $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 $
- * Revision 1.1 1999/01/08 13:02:12 simon
- * Initial checkin: beta 0.43
+ * Revision 1.2 1999/01/08 13:10:15 simon
+ * 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
* Imported ssh-1.2.13.
*
* Revision 1.1.1.1 1996/02/18 21:38:11 ylo
* Imported ssh-1.2.13.
- * $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 $
- * Revision 1.1 1999/01/08 13:02:12 simon
- * Initial checkin: beta 0.43
+ * Revision 1.2 1999/01/08 13:10:15 simon
+ * 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
* Imported ssh-1.2.13.
*
* Revision 1.1.1.1 1996/02/18 21:38:11 ylo
* Imported ssh-1.2.13.
b[0] = IAC; b[1] = SB; b[2] = sb_opt;
b[3] = TELQUAL_IS;
n = 4;
b[0] = IAC; b[1] = SB; b[2] = sb_opt;
b[3] = TELQUAL_IS;
n = 4;
while (*e) {
b[n++] = var;
while (*e && *e != '\t') b[n++] = *e++;
while (*e) {
b[n++] = var;
while (*e && *e != '\t') b[n++] = *e++;
right = (r - 1) / font_width;
top = t / font_height;
bottom = (b - 1) / font_height;
right = (r - 1) / font_width;
top = t / font_height;
bottom = (b - 1) / font_height;
- for (i = top; i <= bottom; i++)
- for (j = left; j <= right; j++)
+ for (i = top; i <= bottom && j<rows ; i++)
+ for (j = left; j <= right && j<cols ; j++)
disptext[i*(cols+1)+j] = ATTR_INVALID;
do_paint (ctx, FALSE);
disptext[i*(cols+1)+j] = ATTR_INVALID;
do_paint (ctx, FALSE);
}
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) {
deselect();
if (b == MB_SELECT && a == MA_CLICK) {
deselect();
wpps (sesskey, "TerminalType", cfg.termtype);
wpps (sesskey, "TerminalSpeed", cfg.termspeed);
{
wpps (sesskey, "TerminalType", cfg.termtype);
wpps (sesskey, "TerminalSpeed", cfg.termspeed);
{
- char buf[2*sizeof(cfg.environ)], *p, *q;
+ char buf[2*sizeof(cfg.environmt)], *p, *q;
while (*q) {
while (*q) {
int c = *q++;
while (*q) {
while (*q) {
int c = *q++;
gpps (sesskey, "TerminalSpeed", "38400,38400", cfg.termspeed,
sizeof(cfg.termspeed));
{
gpps (sesskey, "TerminalSpeed", "38400,38400", 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));
p = buf;
gpps (sesskey, "Environment", "", buf, sizeof(buf));
p = buf;
while (*p) {
while (*p && *p != ',') {
int c = *p++;
while (*p) {
while (*p && *p != ',') {
int c = *p++;
SetDlgItemText (hwnd, IDC3_TSEDIT, cfg.termspeed);
SetDlgItemText (hwnd, IDC3_LOGEDIT, cfg.username);
{
SetDlgItemText (hwnd, IDC3_TSEDIT, cfg.termspeed);
SetDlgItemText (hwnd, IDC3_LOGEDIT, cfg.username);
{
+ char *p = cfg.environmt;
while (*p) {
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_ADDSTRING, 0,
(LPARAM) p);
while (*p) {
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_ADDSTRING, 0,
(LPARAM) p);
case IDC3_ENVADD:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) {
case IDC3_ENVADD:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) {
- char str[sizeof(cfg.environ)];
+ char str[sizeof(cfg.environmt)];
char *p;
GetDlgItemText (hwnd, IDC3_VAREDIT, str, sizeof(str)-1);
if (!*str) {
char *p;
GetDlgItemText (hwnd, IDC3_VAREDIT, str, sizeof(str)-1);
if (!*str) {
while (*p) {
while (*p) p++;
p++;
}
while (*p) {
while (*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);
p[strlen(str)+1] = '\0';
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_ADDSTRING,
strcpy (p, str);
p[strlen(str)+1] = '\0';
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_ADDSTRING,
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_DELETESTRING,
i, 0);
SendDlgItemMessage (hwnd, IDC3_ENVLIST, LB_DELETESTRING,
i, 0);
while (i > 0) {
if (!*p)
goto disaster;
while (i > 0) {
if (!*p)
goto disaster;
+
+#define X_POS(l) ((int)(short)LOWORD(l))
+#define Y_POS(l) ((int)(short)HIWORD(l))
+
- click (MB_SELECT, LOWORD(lParam) / font_width,
- HIWORD(lParam) / font_height);
+ SetCapture(hwnd);
+ click (MB_SELECT, X_POS(lParam) / font_width,
+ Y_POS(lParam) / font_height);
return 0;
case WM_LBUTTONUP:
return 0;
case WM_LBUTTONUP:
- term_mouse (MB_SELECT, MA_RELEASE, LOWORD(lParam) / font_width,
- HIWORD(lParam) / font_height);
+ term_mouse (MB_SELECT, MA_RELEASE, X_POS(lParam) / font_width,
+ Y_POS(lParam) / font_height);
+ ReleaseCapture();
return 0;
case WM_MBUTTONDOWN:
return 0;
case WM_MBUTTONDOWN:
click (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
click (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
- LOWORD(lParam) / font_width,
- HIWORD(lParam) / font_height);
+ X_POS(lParam) / font_width,
+ Y_POS(lParam) / font_height);
return 0;
case WM_MBUTTONUP:
term_mouse (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
return 0;
case WM_MBUTTONUP:
term_mouse (cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND,
- MA_RELEASE, LOWORD(lParam) / font_width,
- HIWORD(lParam) / font_height);
+ MA_RELEASE, X_POS(lParam) / font_width,
+ Y_POS(lParam) / font_height);
click (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
click (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
- LOWORD(lParam) / font_width,
- HIWORD(lParam) / font_height);
+ X_POS(lParam) / font_width,
+ Y_POS(lParam) / font_height);
return 0;
case WM_RBUTTONUP:
term_mouse (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
return 0;
case WM_RBUTTONUP:
term_mouse (cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE,
- MA_RELEASE, LOWORD(lParam) / font_width,
- HIWORD(lParam) / font_height);
+ MA_RELEASE, X_POS(lParam) / font_width,
+ Y_POS(lParam) / font_height);
+ ReleaseCapture();
return 0;
case WM_MOUSEMOVE:
/*
return 0;
case WM_MOUSEMOVE:
/*
b = cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND;
else
b = cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE;
b = cfg.mouse_is_xterm ? MB_PASTE : MB_EXTEND;
else
b = cfg.mouse_is_xterm ? MB_EXTEND : MB_PASTE;
- term_mouse (b, MA_DRAG, LOWORD(lParam) / font_width,
- HIWORD(lParam) / font_height);
+ term_mouse (b, MA_DRAG, X_POS(lParam) / font_width,
+ Y_POS(lParam) / font_height);
}
lastbtn = MB_NOTHING;
lastact = MA_NOTHING;
}
lastbtn = MB_NOTHING;
lastact = MA_NOTHING;
sfree (window_name);
window_name = smalloc(1+strlen(title));
strcpy (window_name, title);
sfree (window_name);
window_name = smalloc(1+strlen(title));
strcpy (window_name, title);
+ if (cfg.win_name_always || !IsIconic(hwnd))
SetWindowText (hwnd, title);
}
SetWindowText (hwnd, title);
}
sfree (icon_name);
icon_name = smalloc(1+strlen(title));
strcpy (icon_name, title);
sfree (icon_name);
icon_name = smalloc(1+strlen(title));
strcpy (icon_name, title);
+ if (!cfg.win_name_always && IsIconic(hwnd))
SetWindowText (hwnd, title);
}
SetWindowText (hwnd, title);
}