X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=settings.c;h=2aae3f1d61618196e315eaf324e166b3e50939f2;hb=1472aa2a265dfbfe7225729862ea21b5fb2da22f;hp=5d8f0c41b2e467e89d92368c8380427d41ea9f5f;hpb=bc6e0952ef1c27c577318ee3c0883c7823c7005b;p=PuTTY.git diff --git a/settings.c b/settings.c index 5d8f0c41..2aae3f1d 100644 --- a/settings.c +++ b/settings.c @@ -178,7 +178,7 @@ static int gppmap(void *handle, char *name, Conf *conf, int primary) val = q; *q = '\0'; - if (primary == CONF_portfwd && buf[0] == 'D') { + if (primary == CONF_portfwd && strchr(buf, 'D') != NULL) { /* * Backwards-compatibility hack: dynamic forwardings are * indexed in the data store as a third type letter in the @@ -188,9 +188,10 @@ static int gppmap(void *handle, char *name, Conf *conf, int primary) * _listening_ on a local port, and are hence mutually * exclusive on the same port number. So here we translate * the legacy storage format into the sensible internal - * form. + * form, by finding the D and turning it into a L. */ - char *newkey = dupcat("L", buf+1, NULL); + char *newkey = dupstr(buf); + *strchr(newkey, 'D') = 'L'; conf_set_str_str(conf, primary, newkey, "D"); sfree(newkey); } else { @@ -232,9 +233,13 @@ static void wmap(void *handle, char const *outkey, Conf *conf, int primary) * conceptually incoherent legacy storage format (key * "D", value empty). */ + char *L; + realkey = key; /* restore it at end of loop */ val = ""; - key = dupcat("D", key+1, NULL); + key = dupstr(key); + L = strchr(key, 'L'); + if (L) *L = 'D'; } else { realkey = NULL; } @@ -620,6 +625,7 @@ void save_open_settings(void *sesskey, Conf *conf) write_setting_i(sesskey, "BugPKSessID2", 2-conf_get_int(conf, CONF_sshbug_pksessid2)); write_setting_i(sesskey, "BugRekey2", 2-conf_get_int(conf, CONF_sshbug_rekey2)); write_setting_i(sesskey, "BugMaxPkt2", 2-conf_get_int(conf, CONF_sshbug_maxpkt2)); + write_setting_i(sesskey, "BugWinadj", 2-conf_get_int(conf, CONF_sshbug_winadj)); write_setting_i(sesskey, "StampUtmp", conf_get_int(conf, CONF_stamp_utmp)); write_setting_i(sesskey, "LoginShell", conf_get_int(conf, CONF_login_shell)); write_setting_i(sesskey, "ScrollbarOnLeft", conf_get_int(conf, CONF_scrollbar_on_left)); @@ -847,7 +853,7 @@ void load_open_settings(void *sesskey, Conf *conf) / 1000 #endif ); - gppi(sesskey, "ScrollbackLines", 200, conf, CONF_savelines); + gppi(sesskey, "ScrollbackLines", 2000, conf, CONF_savelines); gppi(sesskey, "DECOriginMode", 0, conf, CONF_dec_om); gppi(sesskey, "AutoWrapMode", 1, conf, CONF_wrap_mode); gppi(sesskey, "LFImpliesCR", 0, conf, CONF_lfhascr); @@ -865,7 +871,7 @@ void load_open_settings(void *sesskey, Conf *conf) gppi(sesskey, "TryPalette", 0, conf, CONF_try_palette); gppi(sesskey, "ANSIColour", 1, conf, CONF_ansi_colour); gppi(sesskey, "Xterm256Colour", 1, conf, CONF_xterm_256_colour); - i = gppi_raw(sesskey, "BoldAsColour", 0); conf_set_int(conf, CONF_bold_style, i+1); + i = gppi_raw(sesskey, "BoldAsColour", 1); conf_set_int(conf, CONF_bold_style, i+1); for (i = 0; i < 22; i++) { static const char *const defaults[] = { @@ -960,6 +966,7 @@ void load_open_settings(void *sesskey, Conf *conf) i = gppi_raw(sesskey, "BugPKSessID2", 0); conf_set_int(conf, CONF_sshbug_pksessid2, 2-i); i = gppi_raw(sesskey, "BugRekey2", 0); conf_set_int(conf, CONF_sshbug_rekey2, 2-i); i = gppi_raw(sesskey, "BugMaxPkt2", 0); conf_set_int(conf, CONF_sshbug_maxpkt2, 2-i); + i = gppi_raw(sesskey, "BugWinadj", 0); conf_set_int(conf, CONF_sshbug_winadj, 2-i); conf_set_int(conf, CONF_ssh_simple, FALSE); gppi(sesskey, "StampUtmp", 1, conf, CONF_stamp_utmp); gppi(sesskey, "LoginShell", 1, conf, CONF_login_shell);