From ba19b86efdff32e93c73e3dd8e507a640b5dff03 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 27 Jul 2015 09:50:33 +0800 Subject: [PATCH] Clean up config handling a little --- src/common/config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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") ) -- 2.20.1