Now compiles in cgi.[ch]
[privoxy.git] / loadcfg.c
index e7dccc8..4bb99d1 100644 (file)
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.10 2001/06/03 11:03:48 oes Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.10 2001/06/03 19:11:54 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -35,6 +35,9 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.10 2001/06/03 11:03:48 oes Exp $"
  *
  * Revisions   :
  *    $Log: loadcfg.c,v $
+ *    Revision 1.10  2001/06/03 19:11:54  oes
+ *    introduced confdir option
+ *
  *    Revision 1.10  2001/06/03 11:03:48  oes
  *    Makefile/in
  *
@@ -293,6 +296,7 @@ static struct file_list *current_configfile = NULL;
 #define hash_actions_file              3825730796ul /* FIXME "permissionsfile" */
 #define hash_debug                          78263ul
 #define hash_confdir                      1978389lu
+#define hash_logdir                        422889lu
 #define hash_forwardfile               1268669141ul
 #define hash_jarfile                      2046641ul
 #define hash_listen_address            1255650842ul
@@ -450,6 +454,8 @@ struct configuration_spec * load_config(void)
       char arg[BUFSIZ];
       char tmp[BUFSIZ];
 
+      char arg2[BUFSIZ];
+
       strcpy(tmp, buf);
 
       /* Copy command (i.e. up to space or tab) into cmd */
@@ -494,7 +500,8 @@ struct configuration_spec * load_config(void)
 #ifdef TRUST_FILES
          case hash_trustfile :
             freez((char *)config->trustfile);
-            config->trustfile = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg);
+            config->trustfile = strdup(arg2);
             continue;
 
          case hash_trust_info_url :
@@ -510,24 +517,31 @@ struct configuration_spec * load_config(void)
             config->confdir = strdup(arg);
             continue;            
 
+         case hash_logdir :
+            config->logdir = strdup(arg);
+            continue;            
+
          case hash_single_threaded :
             config->multi_threaded = 0;
             continue;
 
          case hash_actions_file :
             freez((char *)config->actions_file);
-            config->actions_file = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg);
+            config->actions_file = strdup(arg2);
             continue;
 
          case hash_logfile :
             freez((char *)config->logfile);
-            config->logfile = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->logdir, arg);
+            config->logfile = strdup(arg2);
             continue;
 
 #ifdef JAR_FILES
          case hash_jarfile :
             freez((char *)config->jarfile);
-            config->jarfile = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->logdir, arg);
+            config->jarfile = strdup(arg2);
             continue;
 #endif /* def JAR_FILES */
 
@@ -538,13 +552,15 @@ struct configuration_spec * load_config(void)
 
          case hash_forwardfile :
             freez((char *)config->forwardfile);
-            config->forwardfile = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg);
+            config->forwardfile = strdup(arg2);
             continue;
 
 #ifdef ACL_FILES
          case hash_aclfile :
             freez((char *)config->aclfile);
-            config->aclfile = strdup(arg);
+                               snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg);
+            config->aclfile = strdup(arg2);
             continue;
 #endif /* def ACL_FILES */