From: John Hodge Date: Mon, 27 Jul 2015 01:50:33 +0000 (+0800) Subject: Clean up config handling a little X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=ba19b86efdff32e93c73e3dd8e507a640b5dff03;p=tpg%2Fopendispense2.git Clean up config handling a little --- diff --git a/src/common/config.c b/src/common/config.c index ca6db69..886da57 100644 --- a/src/common/config.c +++ b/src/common/config.c @@ -80,12 +80,12 @@ int Config_ParseFile(const char *Filename) } } - while( i --, isspace(line[i]) ) - line[i] = 0; + // Trim trailing whitespace + while( i -- && isspace(line[i]) ) + line[i] = '\0'; } - - if( regexec(®exp_empty, line, 1, matches, 0) == 0 ) + if( line[0] == '\0' ) // regexec(®exp_empty, line, 1, matches, 0) == 0 ) continue ; if( RunRegex(®exp_option, line, 3, matches, "Parsing configuration file") )