Changed quoting of CODE_STATUS for use in make
[privoxy.git] / loadcfg.c
index d92dbec..9d39f44 100644 (file)
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.24 2001/10/23 21:40:30 jongfoster Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.27 2001/11/07 00:02:13 steudten Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -35,6 +35,26 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.24 2001/10/23 21:40:30 jongfoster
  *
  * Revisions   :
  *    $Log: loadcfg.c,v $
+ *    Revision 1.27  2001/11/07 00:02:13  steudten
+ *    Add line number in error output for lineparsing for
+ *    actionsfile and configfile.
+ *    Special handling for CLF added.
+ *
+ *    Revision 1.26  2001/11/05 21:41:43  steudten
+ *    Add changes to be a real daemon just for unix os.
+ *    (change cwd to /, detach from controlling tty, set
+ *    process group and session leader to the own process.
+ *    Add DBG() Macro.
+ *    Add some fatal-error log message for failed malloc().
+ *    Add '-d' if compiled with 'configure --with-debug' to
+ *    enable debug output.
+ *
+ *    Revision 1.25  2001/10/25 03:40:48  david__schmidt
+ *    Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple
+ *    threads to call select() simultaneously.  So, it's time to do a real, live,
+ *    native OS/2 port.  See defines for __EMX__ (the porting layer) vs. __OS2__
+ *    (native). Both versions will work, but using __OS2__ offers multi-threading.
+ *
  *    Revision 1.24  2001/10/23 21:40:30  jongfoster
  *    Added support for enable-edit-actions and enable-remote-toggle config
  *    file options.
@@ -334,7 +354,6 @@ static struct file_list *current_configfile = NULL;
 
 static void savearg(char *c, char *o, struct configuration_spec * config);
 
-
 /*********************************************************************
  *
  * Function    :  unload_configfile
@@ -424,8 +443,10 @@ struct configuration_spec * load_config(void)
    struct configuration_spec * config = NULL;
    struct client_state * fake_csp;
    struct file_list *fs;
+   unsigned long linenum = 0;
 
-   if (!check_file_changed(current_configfile, configfile, &fs))
+   DBG(1, ("load_config() entered..\n") );
+   if ( !check_file_changed(current_configfile, configfile, &fs))
    {
       /* No need to load */
       return ((struct configuration_spec *)current_configfile->f);
@@ -436,7 +457,9 @@ struct configuration_spec * load_config(void)
                 configfile);
    }
 
+   /*
    log_error(LOG_LEVEL_INFO, "loading configuration file '%s':", configfile);
+   */
 
 #ifdef FEATURE_TOGGLE
    g_bToggleIJB      = 1;
@@ -478,7 +501,7 @@ struct configuration_spec * load_config(void)
       /* Never get here - LOG_LEVEL_FATAL causes program exit */
    }
 
-   while (read_config_line(buf, sizeof(buf), configfp) != NULL)
+   while (read_config_line(buf, sizeof(buf), configfp, &linenum) != NULL)
    {
       char cmd[BUFFER_SIZE];
       char arg[BUFFER_SIZE];
@@ -560,7 +583,7 @@ struct configuration_spec * load_config(void)
  ****************************************************************************/
          case hash_confdir :
             freez(config->confdir);
-            config->confdir = strdup(arg);
+            config->confdir = make_path( NULL, arg);
             continue;
 
 /****************************************************************************
@@ -924,7 +947,7 @@ struct configuration_spec * load_config(void)
  ****************************************************************************/
          case hash_logdir :
             freez(config->logdir);
-            config->logdir = strdup(arg);
+            config->logdir = make_path(NULL, arg);
             continue;
 
 /****************************************************************************
@@ -1203,8 +1226,11 @@ 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 (%luul) in "
+            log_error(LOG_LEVEL_ERROR, "Unrecognized directive '%s' in line %lu in "
+                  "configuration file (%s).",  buf, linenum, configfile);
+            /* log_error(LOG_LEVEL_ERROR, "Unrecognized directive (%luul) in "
                   "configuration file: \"%s\"", hash_string( cmd ), buf);
+           */
             config->proxy_args = strsav( config->proxy_args, "<br>\nWARNING: unrecognized directive : ");
             config->proxy_args = strsav( config->proxy_args, buf);
             config->proxy_args = strsav( config->proxy_args, "<br><br>\n");
@@ -1346,6 +1372,7 @@ struct configuration_spec * load_config(void)
    files->next = fs;
 
    current_configfile = fs;
+   MustReload = 0;
 
    return (config);
 }