Commit 8a19c4a7 authored by Andrew Gregory's avatar Andrew Gregory Committed by Allan McRae
Browse files

ini: only recognize comments at beginning of line



Allows the hash sign to be used in values in config files and hooks.

Fixes #48702
Signed-off-by: default avatarAndrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae's avatarAllan McRae <allan@archlinux.org>
parent 67602c4c
......@@ -61,19 +61,14 @@ int parse_ini(const char *file, ini_parser_fn cb, void *data)
}
while(safe_fgets(line, PATH_MAX, fp)) {
char *key, *value, *ptr;
char *key, *value;
size_t line_len;
linenum++;
/* ignore whole line and end of line comments */
if((ptr = strchr(line, '#'))) {
*ptr = '\0';
}
line_len = strtrim(line);
if(line_len == 0) {
if(line_len == 0 || line[0] == '#') {
continue;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment