Skip comment lines in config file starting with '#' or ';' correctly

SVN revision: 1745
This commit is contained in:
2006-11-08 07:07:25 +00:00
parent 8d782aa686
commit e8a8c76860
+5 -1
View File
@@ -2806,7 +2806,11 @@ int parse_config_file(char *file_name)
p = buffer;
index = 0;
do {
if (*p == '[') {
if (*p == '#' || *p == ';') {
/* skip comment */
while (*p && *p != '\n' && *p != '\r')
p++;
} else if (*p == '[') {
p++;
pstr = str;
while (*p && *p != ']' && *p != '\n' && *p != '\r' && pstr - str < 10000)