X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=blobdiff_plain;f=config.c;h=7fe6874d1c86a1e1617a9ea0c6ae509158de6046;hp=395bcf27c1e14ced60df3e3d0dbcd1964b59b4f0;hb=4e09868aec19cdc25a5d991fff8d93ec90c013d8;hpb=bbf5dd7221e8297a95a1b3d7b3937782ea7ca5d4 diff --git a/config.c b/config.c index 395bcf2..7fe6874 100644 --- a/config.c +++ b/config.c @@ -39,7 +39,7 @@ struct swb_config_option swb_config_options[] = { /* Browser Switchboard configuration defaults */ static struct swb_config swb_config_defaults = { .flags = SWB_CONFIG_INITIALIZED, - .continuous_mode = 0, + .continuous_mode = 1, .default_browser = "microb", .other_browser_cmd = NULL, .logging = "stdout", @@ -101,8 +101,8 @@ static int swb_config_load_option(struct swb_config *cfg, char *name, char *value) { struct swb_config_option *opt; ptrdiff_t i; - int retval = 0; + /* Search through list of recognized config options for a match */ for (opt = swb_config_options; opt->name; ++opt) { if (strcmp(name, opt->name)) continue; @@ -124,14 +124,12 @@ static int swb_config_load_option(struct swb_config *cfg, We want the first value, so ignore this one */ free(value); } - retval = 1; - break; + return 1; } - if (!retval) - free(value); - - return retval; + /* Unrecognized config option */ + free(value); + return 0; } /* Read the config file and load settings into the provided swb_config struct