~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tong Ho points out a missing ssh_pkt_ensure().
[sgt/putty]
/
windows
/
window.c
diff --git
a/windows/window.c
b/windows/window.c
index
ceeaa76
..
1df5fee
100644
(file)
--- a/
windows/window.c
+++ b/
windows/window.c
@@
-361,6
+361,10
@@
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
{
char *p;
int got_host = 0;
{
char *p;
int got_host = 0;
+ /* By default, we bring up the config dialog, rather than launching
+ * a session. This gets set to TRUE if something happens to change
+ * that (e.g., a hostname is specified on the command-line). */
+ int allow_launch = FALSE;
default_protocol = be_default_protocol;
/* Find the appropriate default port. */
default_protocol = be_default_protocol;
/* Find the appropriate default port. */
@@
-397,7
+401,7
@@
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
if (!cfg_launchable(&cfg) && !do_config()) {
cleanup_exit(0);
}
if (!cfg_launchable(&cfg) && !do_config()) {
cleanup_exit(0);
}
-
loaded_session = TRUE;
/* allow it to be launched directly */
+
allow_launch = TRUE;
/* allow it to be launched directly */
} else if (*p == '&') {
/*
* An initial & means we've been given a command line
} else if (*p == '&') {
/*
* An initial & means we've been given a command line
@@
-413,10
+417,10
@@
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
cfg = *cp;
UnmapViewOfFile(cp);
CloseHandle(filemap);
cfg = *cp;
UnmapViewOfFile(cp);
CloseHandle(filemap);
- loaded_session = TRUE;
} else if (!do_config()) {
cleanup_exit(0);
}
} else if (!do_config()) {
cleanup_exit(0);
}
+ allow_launch = TRUE;
} else {
/*
* Otherwise, break up the command line and deal with
} else {
/*
* Otherwise, break up the command line and deal with
@@
-541,8
+545,10
@@
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
cmdline_run_saved(&cfg);
cmdline_run_saved(&cfg);
- if ((!loaded_session || !cfg_launchable(&cfg)) &&
- !do_config()) {
+ if (loaded_session || got_host)
+ allow_launch = TRUE;
+
+ if ((!allow_launch || !cfg_launchable(&cfg)) && !do_config()) {
cleanup_exit(0);
}
cleanup_exit(0);
}
@@
-3566,8
+3572,9
@@
int char_width(Context ctx, int uc) {
/*
* Translate a WM_(SYS)?KEY(UP|DOWN) message into a string of ASCII
/*
* Translate a WM_(SYS)?KEY(UP|DOWN) message into a string of ASCII
- * codes. Returns number of bytes used or zero to drop the message
- * or -1 to forward the message to windows.
+ * codes. Returns number of bytes used, zero to drop the message,
+ * -1 to forward the message to Windows, or another negative number
+ * to indicate a NUL-terminated "special" string.
*/
static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
unsigned char *output)
*/
static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
unsigned char *output)
@@
-3987,9
+3994,9
@@
static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
return p - output;
}
if (wParam == VK_CANCEL && shift_state == 2) { /* Ctrl-Break */
return p - output;
}
if (wParam == VK_CANCEL && shift_state == 2) { /* Ctrl-Break */
- *p++ = 3;
-
*p++ = 0
;
- return
-2
;
+ if (back)
+
back->special(backhandle, TS_BRK)
;
+ return
0
;
}
if (wParam == VK_PAUSE) { /* Break/Pause */
*p++ = 26;
}
if (wParam == VK_PAUSE) { /* Break/Pause */
*p++ = 26;