From ce01b6dbf6969106d81d405ed34ebadf5dd9cbde Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 5 May 2019 01:06:53 +0200 Subject: 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 --- lib/fstree/fstree_from_file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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 }, }; -- cgit v1.2.3