Extensive changes that _should_ fix the socket buffering problems,
[sgt/putty] / settings.c
index 618d753..6f7ea9c 100644 (file)
@@ -110,6 +110,7 @@ void save_settings(char *section, int do_host, Config * cfg)
     write_setting_i(sesskey, "CurType", cfg->cursor_type);
     write_setting_i(sesskey, "BlinkCur", cfg->blink_cur);
     write_setting_i(sesskey, "Beep", cfg->beep);
+    write_setting_i(sesskey, "BeepInd", cfg->beep_ind);
     write_setting_s(sesskey, "BellWaveFile", cfg->bell_wavefile);
     write_setting_i(sesskey, "BellOverload", cfg->bellovl);
     write_setting_i(sesskey, "BellOverloadN", cfg->bellovl_n);
@@ -159,6 +160,26 @@ void save_settings(char *section, int do_host, Config * cfg)
     write_setting_i(sesskey, "BlinkText", cfg->blinktext);
     write_setting_i(sesskey, "X11Forward", cfg->x11_forward);
     write_setting_s(sesskey, "X11Display", cfg->x11_display);
+    write_setting_i(sesskey, "LocalPortAcceptAll", cfg->lport_acceptall);
+    {
+       char buf[2 * sizeof(cfg->portfwd)], *p, *q;
+       p = buf;
+       q = cfg->portfwd;
+       while (*q) {
+           while (*q) {
+               int c = *q++;
+               if (c == '=' || c == ',' || c == '\\')
+                   *p++ = '\\';
+               if (c == '\t')
+                   c = '=';
+               *p++ = c;
+           }
+           *p++ = ',';
+           q++;
+       }
+       *p = '\0';
+       write_setting_s(sesskey, "PortForwardings", buf);
+    }
 
     close_settings_w(sesskey);
 }
@@ -273,6 +294,7 @@ void load_settings(char *section, int do_host, Config * cfg)
     gppi(sesskey, "BlinkCur", 0, &cfg->blink_cur);
     /* pedantic compiler tells me I can't use &cfg->beep as an int * :-) */
     gppi(sesskey, "Beep", 1, &i); cfg->beep = i;
+    gppi(sesskey, "BeepInd", 0, &i); cfg->beep_ind = i;
     gpps(sesskey, "BellWaveFile", "", cfg->bell_wavefile,
         sizeof(cfg->bell_wavefile));
     gppi(sesskey, "BellOverload", 1, &cfg->bellovl);
@@ -351,7 +373,7 @@ void load_settings(char *section, int do_host, Config * cfg)
            cfg->wordness[j] = atoi(q);
        }
     }
-    gpps(sesskey, "LineCodePage", "", cfg->line_codepage,
+    gpps(sesskey, "LineCodePage", "ISO-8859-1:1987", cfg->line_codepage,
         sizeof(cfg->line_codepage));
     gppi(sesskey, "ScrollBar", 1, &cfg->scrollbar);
     gppi(sesskey, "ScrollOnKey", 0, &cfg->scroll_on_key);
@@ -363,6 +385,28 @@ void load_settings(char *section, int do_host, Config * cfg)
     gpps(sesskey, "X11Display", "localhost:0", cfg->x11_display,
         sizeof(cfg->x11_display));
 
+    gppi(sesskey, "LocalPortAcceptAll", 0, &cfg->lport_acceptall);
+    {
+       char buf[2 * sizeof(cfg->portfwd)], *p, *q;
+       gpps(sesskey, "PortForwardings", "", buf, sizeof(buf));
+       p = buf;
+       q = cfg->portfwd;
+       while (*p) {
+           while (*p && *p != ',') {
+               int c = *p++;
+               if (c == '=')
+                   c = '\t';
+               if (c == '\\')
+                   c = *p++;
+               *q++ = c;
+           }
+           if (*p == ',')
+               p++;
+           *q++ = '\0';
+       }
+       *q = '\0';
+    }
+
     close_settings_r(sesskey);
 }