From 400c895cedc1e454aee3e44022cf15f2343b6740 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 12 Jul 2024 17:28:51 +0100 Subject: [PATCH] settings.c: Don't ignore boolean settings Revision 1b2f39c24bb6591a4192377d9393f5c3e45cb5bd introduced guards to use the built-in defaults in the event that the SESSKEY was null. This was later reverted in 39c20d4819794417e4e84429d1eb5430e3865b25 because (a) a null SESSKEY is precisely how the absence of a per-session configuration file is signalled to the backend, and (b) everything could apparently already cope with a null SESSKEY anyway. Unfortunately, in between these, 3214563d8ed7469e20d4ffdddd55c430334ce803 introduced new functions for handling boolean-valued settings. The reversion didn't affect the new `gppb_raw' function, which retained the erroneous guard against null SESSKEY. In consequence, PuTTY ignores X resources and `-xrm' settings unless `~/.putty/sessions/Default%20Settings' exists, causing undesirable behaviour such as starting login shells, establishing `utmp' entries, scrolling on output, failing to scroll on keypress, not blinking the cursor, etc. This isn't a total disaster: touching `~/.putty/sessions/Default%20Settings' makes the problem go away. But it seems worth fixing anyway. Apply the obvious one-line fix. Signed-off-by: Mark Wooding --- settings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.c b/settings.c index 075656f7..b81d0593 100644 --- a/settings.c +++ b/settings.c @@ -168,7 +168,7 @@ static void gppfile(settings_r *sesskey, const char *name, static bool gppb_raw(settings_r *sesskey, const char *name, bool def) { def = platform_default_b(name, def); - return sesskey ? read_setting_i(sesskey, name, def) != 0 : def; + return read_setting_i(sesskey, name, def) != 0; } static void gppb(settings_r *sesskey, const char *name, bool def,