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. --- framebuffer/gui.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'framebuffer') diff --git a/framebuffer/gui.c b/framebuffer/gui.c index b8bb5cede..0f3f7b921 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -476,26 +476,27 @@ process_cmdline(int argc, char** argv) return true; } +/* Documented in desktop/options.h */ +void gui_options_init_defaults(void) +{ + /* Set defaults for absent option strings */ + nsoption_setnull_charp(cookie_file, strdup("~/.netsurf/Cookies")); + nsoption_setnull_charp(cookie_jar, strdup("~/.netsurf/Cookies")); + + if (nsoption_charp(cookie_file) == NULL || + nsoption_charp(cookie_jar == NULL)) { + die("Failed initialising cookie options"); + } +} + static void gui_init(int argc, char** argv) { nsfb_t *nsfb; + /* Override, since we have no support for non-core SELECT menu */ nsoption_set_bool(core_select_menu, true); - if (nsoption_charp(cookie_file) == NULL) { - nsoption_set_charp(cookie_file, strdup("~/.netsurf/Cookies")); - LOG(("Using '%s' as Cookies file", nsoption_charp(cookie_file))); - } - - if (nsoption_charp(cookie_jar) == NULL) { - nsoption_set_charp(cookie_jar, strdup("~/.netsurf/Cookies")); - LOG(("Using '%s' as Cookie Jar file", nsoption_charp(cookie_jar))); - } - - if (nsoption_charp(cookie_file) == NULL || nsoption_charp(cookie_jar == NULL)) - die("Failed initialising cookie options"); - if (process_cmdline(argc,argv) != true) die("unable to process command line.\n"); -- cgit v1.2.3