1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-09 23:33:46 -05:00

Switch some Conf settings over to being bool.

I think this is the full set of things that ought logically to be
boolean.

One annoyance is that quite a few radio-button controls in config.c
address Conf fields that are now bool rather than int, which means
that the shared handler function can't just access them all with
conf_{get,set}_int. Rather than back out the rigorous separation of
int and bool in conf.c itself, I've just added a similar alternative
handler function for the bool-typed ones.
This commit is contained in:
Simon Tatham
2018-10-29 19:57:31 +00:00
parent 5691805cbd
commit 1378bb049a
31 changed files with 658 additions and 578 deletions

View File

@ -481,7 +481,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
/* Check whether we're configured to try Pageant, and also whether
* it's available. */
s->try_agent_auth = (conf_get_int(s->conf, CONF_tryagent) &&
s->try_agent_auth = (conf_get_bool(s->conf, CONF_tryagent) &&
agent_exists());
while (pktin->type == SSH1_SMSG_FAILURE) {
@ -793,7 +793,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
*/
s->cur_prompt = new_prompts(s->ppl.seat);
if (conf_get_int(s->conf, CONF_try_tis_auth) &&
if (conf_get_bool(s->conf, CONF_try_tis_auth) &&
(s->supported_auths_mask & (1 << SSH1_AUTH_TIS)) &&
!s->tis_auth_refused) {
s->pwpkt_type = SSH1_CMSG_AUTH_TIS_RESPONSE;
@ -842,7 +842,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
ssh1_pkt_type(pktin->type));
return;
}
} else if (conf_get_int(s->conf, CONF_try_tis_auth) &&
} else if (conf_get_bool(s->conf, CONF_try_tis_auth) &&
(s->supported_auths_mask & (1 << SSH1_AUTH_CCARD)) &&
!s->ccard_auth_refused) {
s->pwpkt_type = SSH1_CMSG_AUTH_CCARD_RESPONSE;
@ -1059,7 +1059,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
ppl_logevent(("Authentication successful"));
if (conf_get_int(s->conf, CONF_compression)) {
if (conf_get_bool(s->conf, CONF_compression)) {
ppl_logevent(("Requesting compression"));
pkt = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_CMSG_REQUEST_COMPRESSION);
put_uint32(pkt, 6); /* gzip compression level */