summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/ini.c11
-rw-r--r--src/common/ini.h2
-rw-r--r--src/common/util-common.c2
-rw-r--r--src/common/util-common.h2
4 files changed, 6 insertions, 11 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;
}
diff --git a/src/common/ini.h b/src/common/ini.h
index e03a83fd..4a4b1edf 100644
--- a/src/common/ini.h
+++ b/src/common/ini.h
@@ -1,7 +1,7 @@
/*
* ini.h
*
- * 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
diff --git a/src/common/util-common.c b/src/common/util-common.c
index 794273fd..6825a435 100644
--- a/src/common/util-common.c
+++ b/src/common/util-common.c
@@ -1,7 +1,7 @@
/*
* util-common.c
*
- * Copyright (c) 2006-2016 Pacman Development Team <pacman-dev@archlinux.org>
+ * Copyright (c) 2006-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
diff --git a/src/common/util-common.h b/src/common/util-common.h
index 14520944..b0280d7a 100644
--- a/src/common/util-common.h
+++ b/src/common/util-common.h
@@ -1,7 +1,7 @@
/*
* util-common.h
*
- * Copyright (c) 2006-2016 Pacman Development Team <pacman-dev@archlinux.org>
+ * Copyright (c) 2006-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