From 6412ff0bfbc76d302ef8f272db94be20195ba07a Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 19 Sep 2025 01:29:28 -0400 Subject: kernel: vfs: Handle root path in vfs_cmt_cnt() Signed-off-by: Ian Moffett --- src/sys/os/vfs_subr.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sys/os/vfs_subr.c') diff --git a/src/sys/os/vfs_subr.c b/src/sys/os/vfs_subr.c index f9f4a60..6cb542c 100644 --- a/src/sys/os/vfs_subr.c +++ b/src/sys/os/vfs_subr.c @@ -111,6 +111,11 @@ vfs_cmp_cnt(const char *path) return -ENOENT; } + /* Is pointing to root? */ + if (path[0] == '/' && path[1] == '\0') { + return 1; + } + p = path; cnt = 0; -- cgit v1.2.3