X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/2c9c6388caa7e80195bffd93be7be7369c20bb98..c8ee61b938e106e6638bf5973401fcfa98900286:/settings.c diff --git a/settings.c b/settings.c index faed9e5a..41127b89 100644 --- a/settings.c +++ b/settings.c @@ -2,7 +2,6 @@ * settings.c: read and write saved sessions. */ -#include #include #include #include "putty.h" @@ -309,6 +308,9 @@ void save_settings(char *section, int do_host, Config * cfg) write_setting_i(sesskey, "BugHMAC2", cfg->sshbug_hmac2); write_setting_i(sesskey, "BugDeriveKey2", cfg->sshbug_derivekey2); write_setting_i(sesskey, "BugRSAPad2", cfg->sshbug_rsapad2); + write_setting_i(sesskey, "BugDHGEx2", cfg->sshbug_dhgex2); + write_setting_i(sesskey, "StampUtmp", cfg->stamp_utmp); + write_setting_i(sesskey, "LoginShell", cfg->login_shell); close_settings_w(sesskey); } @@ -362,7 +364,7 @@ void load_settings(char *section, int do_host, Config * cfg) /* proxy settings */ gpps(sesskey, "ProxyExcludeList", "", cfg->proxy_exclude_list, sizeof(cfg->proxy_exclude_list)); - gppi(sesskey, "ProxyType", PROXY_NONE, &cfg->proxy_type); + gppi(sesskey, "ProxyType", PROXY_NONE, &i); cfg->proxy_type = i; gpps(sesskey, "ProxyHost", "proxy", cfg->proxy_host, sizeof(cfg->proxy_host)); gppi(sesskey, "ProxyPort", 80, &cfg->proxy_port); @@ -403,7 +405,7 @@ void load_settings(char *section, int do_host, Config * cfg) gppi(sesskey, "ChangeUsername", 0, &cfg->change_username); gprefs(sesskey, "Cipher", "\0", ciphernames, CIPHER_MAX, cfg->ssh_cipherlist); - gppi(sesskey, "SshProt", 1, &cfg->sshprot); + gppi(sesskey, "SshProt", 2, &cfg->sshprot); gppi(sesskey, "SSH2DES", 0, &cfg->ssh2_des_cbc); gppi(sesskey, "AuthTIS", 0, &cfg->try_tis_auth); gppi(sesskey, "AuthKI", 1, &cfg->try_ki_auth); @@ -451,8 +453,8 @@ void load_settings(char *section, int do_host, Config * cfg) sizeof(cfg->bell_wavefile)); gppi(sesskey, "BellOverload", 1, &cfg->bellovl); gppi(sesskey, "BellOverloadN", 5, &cfg->bellovl_n); - gppi(sesskey, "BellOverloadT", 2000, &cfg->bellovl_t); - gppi(sesskey, "BellOverloadS", 5000, &cfg->bellovl_s); + gppi(sesskey, "BellOverloadT", 2*TICKSPERSEC, &cfg->bellovl_t); + gppi(sesskey, "BellOverloadS", 5*TICKSPERSEC, &cfg->bellovl_s); gppi(sesskey, "ScrollbackLines", 200, &cfg->savelines); gppi(sesskey, "DECOriginMode", 0, &cfg->dec_om); gppi(sesskey, "AutoWrapMode", 1, &cfg->wrap_mode); @@ -461,10 +463,17 @@ void load_settings(char *section, int do_host, Config * cfg) gpps(sesskey, "WinTitle", "", cfg->wintitle, sizeof(cfg->wintitle)); gppi(sesskey, "TermWidth", 80, &cfg->width); gppi(sesskey, "TermHeight", 24, &cfg->height); +#ifdef _WINDOWS gpps(sesskey, "Font", "Courier New", cfg->font, sizeof(cfg->font)); +#else + gpps(sesskey, "Font", "fixed", cfg->font, sizeof(cfg->font)); +#endif gppi(sesskey, "FontIsBold", 0, &cfg->fontisbold); +#ifdef _WINDOWS gppi(sesskey, "FontCharSet", ANSI_CHARSET, &cfg->fontcharset); +#endif gppi(sesskey, "FontHeight", 10, &cfg->fontheight); +#ifdef _WINDOWS if (cfg->fontheight < 0) { int oldh, newh; HDC hdc = GetDC(NULL); @@ -477,6 +486,7 @@ void load_settings(char *section, int do_host, Config * cfg) newh--; cfg->fontheight = newh; } +#endif gppi(sesskey, "FontVTMode", VT_UNICODE, (int *) &cfg->vtmode); gppi(sesskey, "TryPalette", 0, &cfg->try_palette); gppi(sesskey, "BoldAsColour", 1, &cfg->bold_colour); @@ -540,8 +550,8 @@ void load_settings(char *section, int do_host, Config * cfg) gppi(sesskey, "ScrollBarFullScreen", 0, &cfg->scrollbar_in_fullscreen); gppi(sesskey, "ScrollOnKey", 0, &cfg->scroll_on_key); gppi(sesskey, "ScrollOnDisp", 1, &cfg->scroll_on_disp); - gppi(sesskey, "LockSize", 0, &cfg->resize_action); - gppi(sesskey, "BCE", 0, &cfg->bce); + gppi(sesskey, "LockSize", 0, &i); cfg->resize_action = i; + gppi(sesskey, "BCE", 1, &cfg->bce); gppi(sesskey, "BlinkText", 0, &cfg->blinktext); gppi(sesskey, "X11Forward", 0, &cfg->x11_forward); gpps(sesskey, "X11Display", "localhost:0", cfg->x11_display, @@ -569,20 +579,23 @@ void load_settings(char *section, int do_host, Config * cfg) } *q = '\0'; } - gppi(sesskey, "BugIgnore1", BUG_AUTO, &cfg->sshbug_ignore1); - gppi(sesskey, "BugPlainPW1", BUG_AUTO, &cfg->sshbug_plainpw1); - gppi(sesskey, "BugRSA1", BUG_AUTO, &cfg->sshbug_rsa1); + gppi(sesskey, "BugIgnore1", BUG_AUTO, &i); cfg->sshbug_ignore1 = i; + gppi(sesskey, "BugPlainPW1", BUG_AUTO, &i); cfg->sshbug_plainpw1 = i; + gppi(sesskey, "BugRSA1", BUG_AUTO, &i); cfg->sshbug_rsa1 = i; { int i; - gppi(sesskey, "BugHMAC2", BUG_AUTO, &cfg->sshbug_hmac2); + gppi(sesskey, "BugHMAC2", BUG_AUTO, &i); cfg->sshbug_hmac2 = i; if (cfg->sshbug_hmac2 == BUG_AUTO) { gppi(sesskey, "BuggyMAC", 0, &i); if (i == 1) cfg->sshbug_hmac2 = BUG_ON; } } - gppi(sesskey, "BugDeriveKey2", BUG_AUTO, &cfg->sshbug_derivekey2); - gppi(sesskey, "BugRSAPad2", BUG_AUTO, &cfg->sshbug_rsapad2); + gppi(sesskey, "BugDeriveKey2", BUG_AUTO, &i); cfg->sshbug_derivekey2 = i; + gppi(sesskey, "BugRSAPad2", BUG_AUTO, &i); cfg->sshbug_rsapad2 = i; + gppi(sesskey, "BugDHGEx2", BUG_AUTO, &i); cfg->sshbug_dhgex2 = i; + gppi(sesskey, "StampUtmp", 1, &cfg->stamp_utmp); + gppi(sesskey, "LoginShell", 1, &cfg->login_shell); close_settings_r(sesskey); }