X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/623f81b71eb7e64412adce7cbc1f0d0141f20f51..6f1e7b78af0f9c4c502609392f62771cf2528d8f:/settings.c diff --git a/settings.c b/settings.c index 833a10d2..6f488d82 100644 --- a/settings.c +++ b/settings.c @@ -150,6 +150,8 @@ void save_settings(char *section, int do_host, Config * cfg) /* proxy settings */ write_setting_s(sesskey, "ProxyExcludeList", cfg->proxy_exclude_list); + write_setting_i(sesskey, "ProxyDNS", cfg->proxy_dns); + write_setting_i(sesskey, "ProxyLocalhost", cfg->even_proxy_localhost); write_setting_i(sesskey, "ProxyType", cfg->proxy_type); write_setting_s(sesskey, "ProxyHost", cfg->proxy_host); write_setting_i(sesskey, "ProxyPort", cfg->proxy_port); @@ -319,11 +321,17 @@ void save_settings(char *section, int do_host, Config * cfg) void load_settings(char *section, int do_host, Config * cfg) { - int i; - char prot[10]; void *sesskey; sesskey = open_settings_r(section); + load_open_settings(sesskey, do_host, cfg); + close_settings_r(sesskey); +} + +void load_open_settings(void *sesskey, int do_host, Config *cfg) +{ + int i; + char prot[10]; cfg->ssh_subsys = 0; /* FIXME: load this properly */ cfg->remote_cmd_ptr = cfg->remote_cmd; @@ -383,6 +391,8 @@ 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, "ProxyDNS", PROXYDNS_AUTO, &i); cfg->proxy_dns = i; + gppi(sesskey, "ProxyLocalhost", 0, &cfg->even_proxy_localhost); gppi(sesskey, "ProxyType", PROXY_NONE, &i); cfg->proxy_type = i; gpps(sesskey, "ProxyHost", "proxy", cfg->proxy_host, sizeof(cfg->proxy_host)); @@ -484,6 +494,8 @@ void load_settings(char *section, int do_host, Config * cfg) gppi(sesskey, "TermHeight", 24, &cfg->height); #ifdef _WINDOWS gpps(sesskey, "Font", "Courier New", cfg->font, sizeof(cfg->font)); +#elif defined(macintosh) + gpps(sesskey, "Font", "Monaco", cfg->font, sizeof(cfg->font)); #else gpps(sesskey, "Font", "fixed", cfg->font, sizeof(cfg->font)); #endif @@ -491,7 +503,11 @@ void load_settings(char *section, int do_host, Config * cfg) #ifdef _WINDOWS gppi(sesskey, "FontCharSet", ANSI_CHARSET, &cfg->fontcharset); #endif +#ifdef macintosh + gppi(sesskey, "FontHeight", 9, &cfg->fontheight); +#else gppi(sesskey, "FontHeight", 10, &cfg->fontheight); +#endif #ifdef _WINDOWS if (cfg->fontheight < 0) { int oldh, newh; @@ -582,8 +598,17 @@ void load_settings(char *section, int do_host, Config * cfg) gppi(sesskey, "BCE", 1, &cfg->bce); gppi(sesskey, "BlinkText", 0, &cfg->blinktext); gppi(sesskey, "X11Forward", 0, &cfg->x11_forward); +#ifdef _WINDOWS gpps(sesskey, "X11Display", "localhost:0", cfg->x11_display, sizeof(cfg->x11_display)); +#else + { + /* On Unix, the default X display should simply be $DISPLAY. */ + char *disp = getenv("DISPLAY"); + gpps(sesskey, "X11Display", disp, cfg->x11_display, + sizeof(cfg->x11_display)); + } +#endif gppi(sesskey, "LocalPortAcceptAll", 0, &cfg->lport_acceptall); gppi(sesskey, "RemotePortAcceptAll", 0, &cfg->rport_acceptall); @@ -627,8 +652,6 @@ void load_settings(char *section, int do_host, Config * cfg) gppi(sesskey, "ScrollbarOnLeft", 0, &cfg->scrollbar_on_left); gpps(sesskey, "BoldFont", "", cfg->boldfont, sizeof(cfg->boldfont)); gppi(sesskey, "ShadowBoldOffset", 1, &cfg->shadowboldoffset); - - close_settings_r(sesskey); } void do_defaults(char *session, Config * cfg) @@ -670,7 +693,7 @@ void get_sesslist(struct sesslist *list, int allocate) buflen = bufsize = 0; list->buffer = NULL; - if ((handle = enum_settings_start())) { + if ((handle = enum_settings_start()) != NULL) { do { ret = enum_settings_next(handle, otherbuf, sizeof(otherbuf)); if (ret) {