Clean up config handling a little
authorJohn Hodge <[email protected]>
Mon, 27 Jul 2015 01:50:33 +0000 (09:50 +0800)
committerJohn Hodge <[email protected]>
Mon, 27 Jul 2015 01:50:33 +0000 (09:50 +0800)
src/common/config.c

index ca6db69..886da57 100644 (file)
@@ -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(&regexp_empty, line, 1, matches, 0) == 0 )
+               if( line[0] == '\0' )   // regexec(&regexp_empty, line, 1, matches, 0) == 0 )
                        continue ;
 
                if( RunRegex(&regexp_option, line, 3, matches, "Parsing configuration file") )

UCC git Repository :: git.ucc.asn.au