aboutsummaryrefslogtreecommitdiff
path: root/util-linux/hexdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/hexdump.c')
-rw-r--r--util-linux/hexdump.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index 8ac12f082..48edd70a9 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -16,11 +16,19 @@
16 16
17static void bb_dump_addfile(dumper_t *dumper, char *name) 17static void bb_dump_addfile(dumper_t *dumper, char *name)
18{ 18{
19 parser_t *parser = config_open2(name, xfopen_for_read); 19 char *p;
20 while (config_read(parser, &name, 1, 1, "# \t", 0)) { 20 FILE *fp;
21 bb_dump_add(dumper, name); 21 char *buf;
22
23 fp = xfopen_for_read(name);
24 while ((buf = xmalloc_fgetline(fp)) != NULL) {
25 p = skip_whitespace(buf);
26 if (*p && (*p != '#')) {
27 bb_dump_add(dumper, p);
28 }
29 free(buf);
22 } 30 }
23 config_close(parser); 31 fclose(fp);
24} 32}
25 33
26static const char *const add_strings[] = { 34static const char *const add_strings[] = {