summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
authordzwdz2022-03-26 18:17:08 +0100
committerdzwdz2022-03-26 18:17:08 +0100
commit96f021e783f1e99a1ce7d34c0dfeaef524abc2d1 (patch)
treed1298fbe9ccc1fb900c2d3b076da2429bda2e21c /src/init
parent8ec5fee44bb69d092d6c74ec33a3334d2a34bf0d (diff)
init/fs: add a trailing slash to injected paths
Diffstat (limited to 'src/init')
-rw-r--r--src/init/fs/misc.c4
1 files changed, 3 insertions, 1 deletions
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) {