summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-10-17 14:20:18 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2012-10-17 14:20:18 +0100
commit35eb251244ee360cedef6ec1143e65b59da604a8 (patch)
treeb1f508161b6d7502abd534d786650ca7507373a5 /desktop
parent26ac642ef9f6bb439f10a7fc3188823ba1f7bffd (diff)
downloadnetsurf-35eb251244ee360cedef6ec1143e65b59da604a8.tar.gz
netsurf-35eb251244ee360cedef6ec1143e65b59da604a8.tar.bz2
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.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/netsurf.c1
-rw-r--r--desktop/options.h12
2 files changed, 11 insertions, 2 deletions
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 65765fae4..0b1cffe0a 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -166,6 +166,7 @@ nserror netsurf_init(int *pargc,
LOG(("Using '%s' for Options file", options));
nsoption_read(options);
+ gui_options_init_defaults();
messages_load(messages);
diff --git a/desktop/options.h b/desktop/options.h
index b96aaec52..53c025c18 100644
--- a/desktop/options.h
+++ b/desktop/options.h
@@ -114,13 +114,16 @@ extern struct ns_options nsoptions;
} \
} while (0)
-#define nsoption_setnull_charp(OPTION, VALUE) do { \
- if (nsoptions.OPTION == NULL) { \
+#define nsoption_setnull_charp(OPTION, VALUE) \
+ do { \
+ if (nsoptions.OPTION == NULL) { \
nsoptions.OPTION = VALUE; \
if (*nsoptions.OPTION == 0) { \
free(nsoptions.OPTION); \
nsoptions.OPTION = NULL; \
} \
+ } else { \
+ free(VALUE); \
} \
} while (0)
@@ -175,5 +178,10 @@ int nsoption_snoptionf(char *string, size_t size, unsigned int option,
*/
void nsoption_commandline(int *pargc, char **argv);
+/**
+ * Set default values for unset front-end specific options
+ */
+void gui_options_init_defaults(void);
+
#endif