From 1e9eba6d717ed3132db6b6c232e9d78e0f452568 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 5 Aug 2006 23:09:03 +0000 Subject: Finish the C implementation of rrdui-cgi * Add color support See #77 * Add variable substitutions for environment --- common/config-parser.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'common/config-parser.c') diff --git a/common/config-parser.c b/common/config-parser.c index 36c8ba9..c096104 100644 --- a/common/config-parser.c +++ b/common/config-parser.c @@ -66,10 +66,10 @@ static char* read_config_file(const char** configfile, void* data) { char* config = NULL; - char* newfilename; + char* newfilename; FILE* f = NULL; long len; - int flen; + int flen; ASSERT(configfile); @@ -87,7 +87,7 @@ read_config_file(const char** configfile, void* data) return NULL; } - flen = strlen(*configfile); + flen = strlen(*configfile); if((config = (char*)malloc(len + 4 + flen)) == NULL) { errmsg(*configfile, data, "out of memory"); @@ -110,9 +110,9 @@ read_config_file(const char** configfile, void* data) /* Remove nasty dos line endings */ strcln(config, '\r'); - /* Persistent allocation for filename */ - newfilename = config + len + 2; - strcpy(newfilename, *configfile); + /* Persistent allocation for filename */ + newfilename = config + len + 2; + strcpy(newfilename, *configfile); *configfile = newfilename; return config; @@ -171,7 +171,7 @@ cfg_parse_file(const char* filename, void* data, char** memory) /* No continuation hand off value if necessary */ if(name && value) { - if(cfg_value(filename, header, name, value, data) == -1) + if(cfg_value(filename, header, name, strtrim(value), data) == -1) goto finally; } @@ -212,7 +212,7 @@ cfg_parse_file(const char* filename, void* data, char** memory) t++; name = strtrim(p); - value = strtrim(t); + value = t; } if(name && value) -- cgit v1.2.3