From: oes Date: Fri, 11 Apr 2003 12:06:14 +0000 (+0000) Subject: Addressed bug #719435 X-Git-Tag: v_3_0_3~121 X-Git-Url: http://www.privoxy.org/gitweb/?a=commitdiff_plain;h=c500940dbe7a33ff506cd9d0e843773a852cdf3f;p=privoxy.git Addressed bug #719435 - Extraneous filterfile directives now logged as errors - This and unrecnonised directives now really obvious on status page --- diff --git a/loadcfg.c b/loadcfg.c index 48d1a25d..854a391a 100644 --- a/loadcfg.c +++ b/loadcfg.c @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.48.2.2 2002/11/12 16:28:20 oes Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.48.2.3 2003/03/11 11:53:59 oes Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/Attic/loadcfg.c,v $ @@ -35,6 +35,9 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.48.2.2 2002/11/12 16:28:20 oes Ex * * Revisions : * $Log: loadcfg.c,v $ + * Revision 1.48.2.3 2003/03/11 11:53:59 oes + * Cosmetic: Renamed cryptic variable + * * Revision 1.48.2.2 2002/11/12 16:28:20 oes * Move unrelated variable declaration out of #ifdef FEATURE_ACL; fixes bug #636655 * @@ -838,6 +841,22 @@ struct configuration_spec * load_config(void) continue; #endif /* def FEATURE_CGI_EDIT_ACTIONS */ +/* ************************************************************************* + * filterfile file-name + * In confdir by default. + * *************************************************************************/ + case hash_filterfile : + if(config->re_filterfile) + { + log_error(LOG_LEVEL_ERROR, "Ignoring extraneous directive 'filterfile %s' " + "in line %lu in configuration file (%s).", arg, linenum, configfile); + string_append(&config->proxy_args, + " WARNING: extraneous directive, ignored"); + continue; + } + config->re_filterfile = make_path(config->confdir, arg); + continue; + /* ************************************************************************* * forward url-pattern (.|http-proxy-host[:port]) * *************************************************************************/ @@ -1181,15 +1200,6 @@ struct configuration_spec * load_config(void) config->proxy_info_url = strdup(arg); continue; -/* ************************************************************************* - * re_filterfile file-name - * In confdir by default. - * *************************************************************************/ - case hash_filterfile : - freez(config->re_filterfile); - config->re_filterfile = make_path(config->confdir, arg); - continue; - /* ************************************************************************* * single-threaded * *************************************************************************/ @@ -1370,11 +1380,10 @@ struct configuration_spec * load_config(void) * error. To change back to an error, just change log level * to LOG_LEVEL_FATAL. */ - log_error(LOG_LEVEL_ERROR, "Unrecognized directive '%s' (%luul) in line %lu in " - "configuration file (%s).", buf, hash_string(cmd), linenum, configfile); - string_append(&config->proxy_args, "
\nWARNING: unrecognized directive : "); - string_append(&config->proxy_args, buf); - string_append(&config->proxy_args, "

\n"); + log_error(LOG_LEVEL_ERROR, "Ignoring unrecognized directive '%s' (%luul) in line %lu " + "in configuration file (%s).", buf, hash_string(cmd), linenum, configfile); + string_append(&config->proxy_args, + " WARNING: unrecognized directive, ignored"); continue; /* *************************************************************************/ @@ -1555,7 +1564,7 @@ static void savearg(char *command, char *argument, struct configuration_spec * c * Add config option name embedded in * link to it's section in the user-manual */ - buf = strdup("usermanual); string_append(&buf, CONFIG_HELP_PREFIX); string_join (&buf, string_toupper(command)); @@ -1593,8 +1602,6 @@ static void savearg(char *command, char *argument, struct configuration_spec * c } } - string_append(&buf, "
\n"); - string_join(&config->proxy_args, buf); }