diff options
author | Nick White <arch@njw.me.uk> | 2007-05-26 22:18:56 +0000 |
---|---|---|
committer | Nick White <arch@njw.me.uk> | 2007-05-26 22:18:56 +0000 |
commit | 5b4f728bc58d137dd946030d8c11b309b1216743 (patch) | |
tree | b7b4335fa70b7cbefc8663f68e60ac818dd9ca3c /src/config.c | |
parent | 0ccfa432206769a540be50c6e39295c58bf4ea56 (diff) |
General cleanup, Add alt url config options
Removed unused & unnecessary findnewestiss
Replaces strcpy with strncpy to eliminate possible buffer overruns
Added a couple of config options to allow use of alternative
toc urls
git-archimport-id: getht@sv.gnu.org/getht--mainline--0.1--patch-29
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index 57807b1..8279f54 100644 --- a/src/config.c +++ b/src/config.c @@ -30,6 +30,8 @@ extern long proxy_port; extern proxyauth proxy_auth; extern char proxy_user[STR_MAX]; extern char proxy_pass[STR_MAX]; +extern char issue_url[STR_MAX]; +extern char media_url[STR_MAX]; int loadconfig(char * htde_path, char * issue_path, int * update) /* Loads variables from config file to extern and passed @@ -56,6 +58,10 @@ int loadconfig(char * htde_path, char * issue_path, int * update) strncpy(issue_path, parameter, STR_MAX); else if(!strcmp(option, "startup_check")) *update = atoi(parameter); + else if(!strcmp(option, "toc_url")) + strncpy(issue_url, parameter, STR_MAX); + else if(!strcmp(option, "mediatoc_url")) + strncpy(media_url, parameter, STR_MAX); else if(!strcmp(option, "proxy_type")) { if(!strcmp(parameter, "http")) @@ -117,6 +123,10 @@ int writefreshconfig(char * htde_path, char * issue_path, int * update) fprintf(config_file, "%s = %s\n", "issuepath", issue_path); if(update) fprintf(config_file, "%s = %i\n", "startup_check", *update); + if(issue_url[0]) + fprintf(config_file, "%s = %s\n", "toc_url", issue_url); + if(media_url[0]) + fprintf(config_file, "%s = %s\n", "mediatoc_url", media_url); if(proxy_type != NONE) { if(proxy_type = HTTP) |