summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/hexdump.c16
-rw-r--r--util-linux/mdev.c6
2 files changed, 13 insertions, 9 deletions
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index 8ac12f0..48edd70 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -16,11 +16,19 @@
static void bb_dump_addfile(dumper_t *dumper, char *name)
{
- parser_t *parser = config_open2(name, xfopen_for_read);
- while (config_read(parser, &name, 1, 1, "# \t", 0)) {
- bb_dump_add(dumper, name);
+ char *p;
+ FILE *fp;
+ char *buf;
+
+ fp = xfopen_for_read(name);
+ while ((buf = xmalloc_fgetline(fp)) != NULL) {
+ p = skip_whitespace(buf);
+ if (*p && (*p != '#')) {
+ bb_dump_add(dumper, p);
+ }
+ free(buf);
}
- config_close(parser);
+ fclose(fp);
}
static const char *const add_strings[] = {
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index f6440b1..d0d0103 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -107,10 +107,7 @@ static void make_device(char *path, int delete)
parser = config_open2("/etc/mdev.conf", fopen_for_read);
/* If we have config file, look up user settings */
- if (!parser)
- goto end_parse;
-
- while (config_read(parser, tokens, 4, 3, "# \t", PARSE_LAST_IS_GREEDY)) {
+ while (config_read(parser, tokens, 4, 3, "# \t", PARSE_NORMAL)) {
regmatch_t off[1 + 9*ENABLE_FEATURE_MDEV_RENAME_REGEXP];
char *val;
@@ -244,7 +241,6 @@ static void make_device(char *path, int delete)
} /* end of "while line is read from /etc/mdev.conf" */
config_close(parser);
- end_parse:
#endif /* ENABLE_FEATURE_MDEV_CONF */
if (!delete && sscanf(dev_maj_min, "%u:%u", &major, &minor) == 2) {