1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Remove FLAG_INTERACTIVE.

This is simpler than FLAG_VERBOSE: everywhere we need to check it, we
have a Seat available, so we can just make it a Seat query method.
This commit is contained in:
Simon Tatham
2020-01-30 06:40:21 +00:00
parent d20d3b20fd
commit dc59fcf8e3
14 changed files with 39 additions and 24 deletions

View File

@ -361,6 +361,7 @@ static const SeatVtable win_seat_vt = {
win_seat_stripctrl_new,
win_seat_set_trust_status,
nullseat_verbose_yes,
nullseat_interactive_yes,
};
static Seat win_seat_impl = { &win_seat_vt };
Seat *const win_seat = &win_seat_impl;
@ -484,7 +485,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
hinst = inst;
hwnd = NULL;
flags = FLAG_INTERACTIVE;
cmdline_tooltype |= TOOLTYPE_HOST_ARG | TOOLTYPE_PORT_ARG |
TOOLTYPE_NO_VERBOSE_OPTION;

View File

@ -82,6 +82,13 @@ static int plink_get_userpass_input(Seat *seat, prompts_t *p, bufchain *input)
return ret;
}
static bool plink_seat_interactive(Seat *seat)
{
return (!*conf_get_str(conf, CONF_remote_cmd) &&
!*conf_get_str(conf, CONF_remote_cmd2) &&
!*conf_get_str(conf, CONF_ssh_nc_host));
}
static const SeatVtable plink_seat_vt = {
plink_output,
plink_eof,
@ -102,6 +109,7 @@ static const SeatVtable plink_seat_vt = {
console_stripctrl_new,
console_set_trust_status,
cmdline_seat_verbose,
plink_seat_interactive,
};
static Seat plink_seat[1] = {{ &plink_seat_vt }};
@ -375,11 +383,6 @@ int main(int argc, char **argv)
if (use_subsystem)
conf_set_bool(conf, CONF_ssh_subsys, true);
if (!*conf_get_str(conf, CONF_remote_cmd) &&
!*conf_get_str(conf, CONF_remote_cmd2) &&
!*conf_get_str(conf, CONF_ssh_nc_host))
flags |= FLAG_INTERACTIVE;
/*
* Select protocol. This is farmed out into a table in a
* separate file to enable an ssh-free variant.