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. --- cocoa/NetsurfApp.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cocoa') diff --git a/cocoa/NetsurfApp.m b/cocoa/NetsurfApp.m index 65c9f8cd1..4c2dfc185 100644 --- a/cocoa/NetsurfApp.m +++ b/cocoa/NetsurfApp.m @@ -164,15 +164,21 @@ void cocoa_autorelease( void ) pool = [[NSAutoreleasePool alloc] init]; } +/* Documented in desktop/options.h */ +void gui_options_init_defaults(void) +{ + /* Set defaults for absent option strings */ + const char * const ca_bundle = [[[NSBundle mainBundle] pathForResource: @"ca-bundle" ofType: @""] UTF8String]; + + nsoption_setnull_charp(ca_bundle, strdup(ca_bundle)); +} + int main( int argc, char **argv ) { cocoa_autorelease(); const char * const messages = [[[NSBundle mainBundle] pathForResource: @"Messages" ofType: @""] UTF8String]; const char * const options = cocoa_get_options_file(); - const char * const ca_bundle = [[[NSBundle mainBundle] pathForResource: @"ca-bundle" ofType: @""] UTF8String]; - - nsoption_setnull_charp(ca_bundle, strdup(ca_bundle)); netsurf_init(&argc, &argv, options, messages); -- cgit v1.2.3