From 35eb251244ee360cedef6ec1143e65b59da604a8 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 17 Oct 2012 14:20:18 +0100 Subject: Fix "error setting certificate verify locations" problem when the Choices file doesn't exist. Now there's a single place for front ends to set options overrides. Fix nsoption_setnull_charp leak. --- atari/gui.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'atari') diff --git a/atari/gui.c b/atari/gui.c index a2dac21d3..c2158e05e 100755 --- a/atari/gui.c +++ b/atari/gui.c @@ -553,12 +553,12 @@ gui_window_remove_caret(struct gui_window *w) void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon) -{ - struct bitmap *bmp_icon; +{ + struct bitmap *bmp_icon; + + bmp_icon = (icon != NULL) ? content_get_bitmap(icon) : NULL; - bmp_icon = (icon != NULL) ? content_get_bitmap(icon) : NULL; - - window_set_icon(g, bmp_icon); + window_set_icon(g, bmp_icon); } void @@ -911,6 +911,17 @@ nsurl *gui_get_resource_url(const char *path) return url; } +/* Documented in desktop/options.h */ +void gui_options_init_defaults(void) +{ + /* Set defaults for absent option strings */ + nsoption_setnull_charp(cookie_file, strdup("cookies")); + + if (nsoption_charp(cookie_file) == NULL) { + die("Failed initialising string options"); + } +} + static void gui_init(int argc, char** argv) { char buf[PATH_MAX]; @@ -961,9 +972,6 @@ static void gui_init(int argc, char** argv) urldb_load(nsoption_charp(url_file)); } - if (nsoption_charp(cookie_file) == NULL ){ - nsoption_set_charp(cookie_file, (char*)"cookies"); - } LOG(("Loading cookies from: %s", nsoption_charp(cookie_file) )); if( strlen(nsoption_charp(cookie_file)) ){ urldb_load_cookies(nsoption_charp(cookie_file)); -- cgit v1.2.3