diff options
Diffstat (limited to 'src/common/ini.c')
-rw-r--r-- | src/common/ini.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/common/ini.c b/src/common/ini.c index a4b29d17..e6437de3 100644 --- a/src/common/ini.c +++ b/src/common/ini.c @@ -1,7 +1,7 @@ /* * ini.c * - * Copyright (c) 2013-2016 Pacman Development Team <pacman-dev@archlinux.org> + * Copyright (c) 2013-2017 Pacman Development Team <pacman-dev@archlinux.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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; } |