mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-05 21:42:47 -05:00
Revamp of command-line handling. Most command line options should
now be processed in cmdline.c, which is called from all utilities (well, not Pageant or PuTTYgen). This should mean we get to standardise almost all options across almost all tools. Also one major change: `-load' is now the preferred option for loading a saved session in PuTTY proper. `@session' still works but is deprecated. [originally from svn r1799]
This commit is contained in:
15
console.c
15
console.c
@ -261,27 +261,12 @@ void logevent(char *string)
|
||||
{
|
||||
}
|
||||
|
||||
char *console_password = NULL;
|
||||
|
||||
int console_get_line(const char *prompt, char *str,
|
||||
int maxlen, int is_pw)
|
||||
{
|
||||
HANDLE hin, hout;
|
||||
DWORD savemode, newmode, i;
|
||||
|
||||
if (is_pw && console_password) {
|
||||
static int tried_once = 0;
|
||||
|
||||
if (tried_once) {
|
||||
return 0;
|
||||
} else {
|
||||
strncpy(str, console_password, maxlen);
|
||||
str[maxlen - 1] = '\0';
|
||||
tried_once = 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (console_batch_mode) {
|
||||
if (maxlen > 0)
|
||||
str[0] = '\0';
|
||||
|
Reference in New Issue
Block a user