From 96f021e783f1e99a1ce7d34c0dfeaef524abc2d1 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 26 Mar 2022 18:17:08 +0100 Subject: init/fs: add a trailing slash to injected paths --- src/init/fs/misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/init/fs/misc.c b/src/init/fs/misc.c index d2e2614..a45347a 100644 --- a/src/init/fs/misc.c +++ b/src/init/fs/misc.c @@ -142,8 +142,10 @@ void fs_dir_inject(const char *path) { struct fs_dir_handle h = handles[res.id]; int out_len = 0; - while (h.inject[out_len] != '/') out_len++; // TODO ensure trailing slash + while (h.inject[out_len] != '/') + out_len++; memcpy(buf, h.inject, out_len); + buf[out_len++] = '/'; buf[out_len++] = '\0'; if (h.delegate >= 0) { -- cgit v1.2.3