Set up kbd_codepage at the start of the program, as well as when the
[u/mdw/putty] / settings.c
index 8afd6c2..27c21dd 100644 (file)
@@ -174,6 +174,7 @@ void save_settings(char *section, int do_host, Config * cfg)
     wprefs(sesskey, "Cipher", ciphernames, CIPHER_MAX,
           cfg->ssh_cipherlist);
     write_setting_i(sesskey, "AuthTIS", cfg->try_tis_auth);
+    write_setting_i(sesskey, "AuthKI", cfg->try_ki_auth);
     write_setting_i(sesskey, "SshProt", cfg->sshprot);
     write_setting_i(sesskey, "BuggyMAC", cfg->buggymac);
     write_setting_s(sesskey, "PublicKeyFile", cfg->keyfile);
@@ -234,7 +235,9 @@ void save_settings(char *section, int do_host, Config * cfg)
        write_setting_s(sesskey, buf, buf2);
     }
     write_setting_i(sesskey, "RawCNP", cfg->rawcnp);
+    write_setting_i(sesskey, "PasteRTF", cfg->rtf_paste);
     write_setting_i(sesskey, "MouseIsXterm", cfg->mouse_is_xterm);
+    write_setting_i(sesskey, "RectSelect", cfg->rect_select);
     write_setting_i(sesskey, "MouseOverride", cfg->mouse_override);
     for (i = 0; i < 256; i += 32) {
        char buf[20], buf2[256];
@@ -294,7 +297,11 @@ void load_settings(char *section, int do_host, Config * cfg)
     cfg->remote_cmd_ptr = cfg->remote_cmd;
     cfg->remote_cmd_ptr2 = NULL;
 
-    gpps(sesskey, "HostName", "", cfg->host, sizeof(cfg->host));
+    if (do_host) {
+       gpps(sesskey, "HostName", "", cfg->host, sizeof(cfg->host));
+    } else {
+       cfg->host[0] = '\0';           /* blank hostname */
+    }
     gpps(sesskey, "LogFileName", "putty.log",
         cfg->logfilename, sizeof(cfg->logfilename));
     gppi(sesskey, "LogType", 0, &cfg->logtype);
@@ -354,6 +361,7 @@ void load_settings(char *section, int do_host, Config * cfg)
     gppi(sesskey, "SshProt", 1, &cfg->sshprot);
     gppi(sesskey, "BuggyMAC", 0, &cfg->buggymac);
     gppi(sesskey, "AuthTIS", 0, &cfg->try_tis_auth);
+    gppi(sesskey, "AuthKI", 1, &cfg->try_ki_auth);
     gpps(sesskey, "PublicKeyFile", "", cfg->keyfile, sizeof(cfg->keyfile));
     gpps(sesskey, "RemoteCommand", "", cfg->remote_cmd,
         sizeof(cfg->remote_cmd));
@@ -439,7 +447,9 @@ void load_settings(char *section, int do_host, Config * cfg)
        }
     }
     gppi(sesskey, "RawCNP", 0, &cfg->rawcnp);
+    gppi(sesskey, "PasteRTF", 0, &cfg->rtf_paste);
     gppi(sesskey, "MouseIsXterm", 0, &cfg->mouse_is_xterm);
+    gppi(sesskey, "RectSelect", 0, &cfg->rect_select);
     gppi(sesskey, "MouseOverride", 1, &cfg->mouse_override);
     for (i = 0; i < 256; i += 32) {
        static char *defaults[] = {
@@ -530,6 +540,10 @@ static int sessioncmp(const void *av, const void *bv)
        return -1;                     /* a comes first */
     if (!strcmp(b, "Default Settings"))
        return +1;                     /* b comes first */
+    /*
+     * FIXME: perhaps we should ignore the first & in determining
+     * sort order.
+     */
     return strcmp(a, b);              /* otherwise, compare normally */
 }