summaryrefslogtreecommitdiff
path: root/lib/fstree
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-05 01:06:53 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-05 01:56:50 +0200
commitce01b6dbf6969106d81d405ed34ebadf5dd9cbde (patch)
treebd2b5f1713e61cb13abcf62dc01025b241668904 /lib/fstree
parent949d1c2a5553b54fe6bc2b8c7aca10a892e595d7 (diff)
fix fstree listing parse
- accept "nod" line as advertised, i.e. with space instead of colon - actually accept "sock" line (copy & paste fail) Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree')
-rw-r--r--lib/fstree/fstree_from_file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/fstree/fstree_from_file.c b/lib/fstree/fstree_from_file.c
index 7c6b9ba..aa09780 100644
--- a/lib/fstree/fstree_from_file.c
+++ b/lib/fstree/fstree_from_file.c
@@ -88,8 +88,10 @@ static int add_device(fstree_t *fs, const char *filename, size_t line_num,
while (isdigit(*extra))
maj = maj * 10 + *(extra++) - '0';
- if (*(extra++) != ':')
+ if (!isspace(*extra))
goto fail_devno;
+ while (isspace(*extra))
+ ++extra;
if (!isdigit(*extra))
goto fail_devno;
@@ -223,7 +225,7 @@ static const struct {
{ "slink", add_slink },
{ "nod", add_device },
{ "pipe", add_pipe },
- { "pipe", add_socket },
+ { "sock", add_socket },
{ "file", add_file },
};