1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-04 04:52:47 -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

@ -78,7 +78,7 @@ mainchan *mainchan_new(
{
mainchan *mc;
if (conf_get_int(conf, CONF_ssh_no_shell))
if (conf_get_bool(conf, CONF_ssh_no_shell))
return NULL; /* no main channel at all */
mc = snew(mainchan);
@ -141,7 +141,7 @@ static void mainchan_open_confirmation(Channel *chan)
struct X11FakeAuth *x11auth;
int retry_cmd_now = false;
if (conf_get_int(mc->conf, CONF_x11_forward)) {;
if (conf_get_bool(mc->conf, CONF_x11_forward)) {;
char *x11_setup_err;
if ((x11disp = x11_setup_display(
conf_get_str(mc->conf, CONF_x11_display),
@ -165,7 +165,7 @@ static void mainchan_open_confirmation(Channel *chan)
mc->req_agent = true;
}
if (!conf_get_int(mc->conf, CONF_nopty)) {
if (!conf_get_bool(mc->conf, CONF_nopty)) {
sshfwd_request_pty(
mc->sc, true, mc->conf, mc->term_width, mc->term_height);
mc->req_pty = true;
@ -181,7 +181,7 @@ static void mainchan_open_confirmation(Channel *chan)
ppl_logevent(("Sent %d environment variables", mc->n_req_env));
cmd = conf_get_str(mc->conf, CONF_remote_cmd);
if (conf_get_int(mc->conf, CONF_ssh_subsys)) {
if (conf_get_bool(mc->conf, CONF_ssh_subsys)) {
retry_cmd_now = !sshfwd_start_subsystem(mc->sc, true, cmd);
} else if (*cmd) {
sshfwd_start_command(mc->sc, true, cmd);
@ -204,7 +204,7 @@ static void mainchan_open_confirmation(Channel *chan)
static void mainchan_try_fallback_command(mainchan *mc)
{
const char *cmd = conf_get_str(mc->conf, CONF_remote_cmd2);
if (conf_get_int(mc->conf, CONF_ssh_subsys2)) {
if (conf_get_bool(mc->conf, CONF_ssh_subsys2)) {
sshfwd_start_subsystem(mc->sc, true, cmd);
} else {
sshfwd_start_command(mc->sc, true, cmd);