mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Revert "settings.c: allow load_open_settings(NULL)."
This reverts commit 1b2f39c24bb6591a4192377d9393f5c3e45cb5bd. The intention of that commit was to support the development of Uppity, by arranging that I could get a Conf populated with completely default values by calling load_open_settings(NULL,conf), with no risk of interference from the normal PuTTY saved sessions full of client-side configuration (which would have been confusing to apply unexpectedly in a server). So I arranged that a NULL session handle was never passed to the low-level read_setting_[type] functions, in case it caused a segfault. But I overlooked two things. Firstly, on Unix, read_setting_* is where we check the tree234 of data derived from X resources and/or -xrm command-line options. So if you don't call those functions at all (e.g. if you have no on-disk PuTTY saved configuration at all, not even Default Settings), you also don't get your X defaults honoured. Secondly, those functions themselves already all checked their argument for NULL before doing anything dangerous with it. So the thing I wanted to make possible was already possible _anyway_, without me having to do anything! So I'm exactly reverting that commit, because the _only_ thing it did was to introduce a bug in X resource handling.
This commit is contained in:
parent
b5597cc833
commit
39c20d4819
@ -107,7 +107,7 @@ char *get_remote_username(Conf *conf)
|
|||||||
|
|
||||||
static char *gpps_raw(settings_r *sesskey, const char *name, const char *def)
|
static char *gpps_raw(settings_r *sesskey, const char *name, const char *def)
|
||||||
{
|
{
|
||||||
char *ret = sesskey ? read_setting_s(sesskey, name) : NULL;
|
char *ret = read_setting_s(sesskey, name);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = platform_default_s(name);
|
ret = platform_default_s(name);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
@ -131,7 +131,7 @@ static void gpps(settings_r *sesskey, const char *name, const char *def,
|
|||||||
static void gppfont(settings_r *sesskey, char *name,
|
static void gppfont(settings_r *sesskey, char *name,
|
||||||
Conf *conf, int primary)
|
Conf *conf, int primary)
|
||||||
{
|
{
|
||||||
FontSpec *result = sesskey ? read_setting_fontspec(sesskey, name) : NULL;
|
FontSpec *result = read_setting_fontspec(sesskey, name);
|
||||||
if (!result)
|
if (!result)
|
||||||
result = platform_default_fontspec(name);
|
result = platform_default_fontspec(name);
|
||||||
conf_set_fontspec(conf, primary, result);
|
conf_set_fontspec(conf, primary, result);
|
||||||
@ -140,7 +140,7 @@ static void gppfont(settings_r *sesskey, char *name,
|
|||||||
static void gppfile(settings_r *sesskey, const char *name,
|
static void gppfile(settings_r *sesskey, const char *name,
|
||||||
Conf *conf, int primary)
|
Conf *conf, int primary)
|
||||||
{
|
{
|
||||||
Filename *result = sesskey ? read_setting_filename(sesskey, name) : NULL;
|
Filename *result = read_setting_filename(sesskey, name);
|
||||||
if (!result)
|
if (!result)
|
||||||
result = platform_default_filename(name);
|
result = platform_default_filename(name);
|
||||||
conf_set_filename(conf, primary, result);
|
conf_set_filename(conf, primary, result);
|
||||||
@ -162,7 +162,7 @@ static void gppb(settings_r *sesskey, const char *name, bool def,
|
|||||||
static int gppi_raw(settings_r *sesskey, const char *name, int def)
|
static int gppi_raw(settings_r *sesskey, const char *name, int def)
|
||||||
{
|
{
|
||||||
def = platform_default_i(name, def);
|
def = platform_default_i(name, def);
|
||||||
return sesskey ? read_setting_i(sesskey, name, def) : def;
|
return read_setting_i(sesskey, name, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gppi(settings_r *sesskey, const char *name, int def,
|
static void gppi(settings_r *sesskey, const char *name, int def,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user