diff options
author | Sven Weidauer <sven@5sw.de> | 2017-12-23 10:55:59 +0100 |
---|---|---|
committer | Sven Weidauer <sven@5sw.de> | 2017-12-23 10:55:59 +0100 |
commit | cb452810b98273f1bf3275321386c8393d5c5134 (patch) | |
tree | af32263647bad0f8573c93fd9e426aeec2a57057 /utils/nsoption.c | |
parent | d0549e7a5b14959097a1e8696dce1b1f40c6ba54 (diff) | |
parent | 3c0ff81be45968e1c9d9b989243c975dfeab4cb0 (diff) | |
download | netsurf-cb452810b98273f1bf3275321386c8393d5c5134.tar.gz netsurf-cb452810b98273f1bf3275321386c8393d5c5134.tar.bz2 |
Merge remote-tracking branch 'origin/master' into svenw/cocoa
Diffstat (limited to 'utils/nsoption.c')
-rw-r--r-- | utils/nsoption.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/utils/nsoption.c b/utils/nsoption.c index 8f05a911b..09529a0d0 100644 --- a/utils/nsoption.c +++ b/utils/nsoption.c @@ -187,7 +187,7 @@ static void nsoption_validate(struct nsoption_s *opts, struct nsoption_s *defs) break; } } - if (black == true) { + if (black == true && defs != NULL) { for (cloop = NSOPTION_SYS_COLOUR_START; cloop <= NSOPTION_SYS_COLOUR_END; cloop++) { @@ -209,6 +209,9 @@ static void nsoption_validate(struct nsoption_s *opts, struct nsoption_s *defs) opts[NSOPTION_max_retried_fetches].value.u) > 60) && (opts[NSOPTION_max_retried_fetches].value.u > 1)) opts[NSOPTION_max_retried_fetches].value.u--; + + /* We ignore the result because we can't fail to validate. Yay */ + (void)nslog_set_filter_by_options(); } /** @@ -648,11 +651,12 @@ nsoption_read(const char *path, struct nsoption_s *opts) fp = fopen(path, "r"); if (!fp) { - LOG("Failed to open file '%s'", path); + NSLOG(netsurf, INFO, "Failed to open file '%s'", path); return NSERROR_NOT_FOUND; } - LOG("Successfully opened '%s' for Options file", path); + NSLOG(netsurf, INFO, "Successfully opened '%s' for Options file", + path); while (fgets(s, NSOPTION_MAX_LINE_LEN, fp)) { char *colon, *value; @@ -718,7 +722,8 @@ nsoption_write(const char *path, fp = fopen(path, "w"); if (!fp) { - LOG("failed to open file '%s' for writing", path); + NSLOG(netsurf, INFO, "failed to open file '%s' for writing", + path); return NSERROR_NOT_FOUND; } @@ -798,7 +803,7 @@ nsoption_commandline(int *pargc, char **argv, struct nsoption_s *opts) /* arg+arglen is the option to set, val is the value */ - LOG("%.*s = %s", arglen, arg, val); + NSLOG(netsurf, INFO, "%.*s = %s", arglen, arg, val); for (entry_loop = 0; entry_loop < NSOPTION_LISTEND; @@ -818,6 +823,8 @@ nsoption_commandline(int *pargc, char **argv, struct nsoption_s *opts) } *pargc -= (idx - 1); + nsoption_validate(opts, nsoptions_default); + return NSERROR_OK; } |