summaryrefslogtreecommitdiffhomepage
path: root/src/tinyproxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tinyproxy.c')
-rw-r--r--src/tinyproxy.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/tinyproxy.c b/src/tinyproxy.c
index 6239452..a702e35 100644
--- a/src/tinyproxy.c
+++ b/src/tinyproxy.c
@@ -1,4 +1,4 @@
-/* $Id: tinyproxy.c,v 1.44 2003-02-26 22:37:38 rjkaes Exp $
+/* $Id: tinyproxy.c,v 1.45 2003-03-13 21:32:33 rjkaes Exp $
*
* The initialize routine. Basically sets up all the initial stuff (logfile,
* listening socket, config options, etc.) and then sits there and loops
@@ -152,7 +152,6 @@ main(int argc, char **argv)
unsigned int godaemon = TRUE; /* boolean */
struct passwd *thisuser = NULL;
struct group *thisgroup = NULL;
- char *conf_file = DEFAULT_CONF_FILE;
/*
* Disable the creation of CORE files right up front.
@@ -168,6 +167,9 @@ main(int argc, char **argv)
log_message(LOG_INFO, "Initializing " PACKAGE " ...");
+ /* Default configuration file location */
+ config.config_file = DEFAULT_CONF_FILE;
+
/*
* Process the various options
*/
@@ -183,8 +185,8 @@ main(int argc, char **argv)
godaemon = FALSE;
break;
case 'c':
- conf_file = safestrdup(optarg);
- if (!conf_file) {
+ config.config_file = safestrdup(optarg);
+ if (!config.config_file) {
fprintf(stderr,
"%s: Could not allocate memory.\n",
argv[0]);
@@ -199,13 +201,19 @@ main(int argc, char **argv)
}
/*
+ * Make sure the HTML error pages array is NULL to begin with.
+ * (FIXME: Should have a better API for all this)
+ */
+ config.errorpages = NULL;
+
+ /*
* Read in the settings from the config file.
*/
- yyin = fopen(conf_file, "r");
+ yyin = fopen(config.config_file, "r");
if (!yyin) {
fprintf(stderr,
"%s: Could not open configuration file \"%s\".\n",
- argv[0], conf_file);
+ argv[0], config.config_file);
exit(EX_SOFTWARE);
}
yyparse();