From 48db5eea1d86f68db8b08958d63a86026b8fc296 Mon Sep 17 00:00:00 2001 From: Armin Friedl Date: Mon, 31 Aug 2020 18:58:01 +0200 Subject: [PATCH] Fix path for root case In case of root, res->path returns '.' which does not mix well with concatenating the entry name. For example this may result in `.bin` for a folder `bin` in root. --- dirl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dirl.c b/dirl.c index 1c0689a..67ec21f 100644 --- a/dirl.c +++ b/dirl.c @@ -189,7 +189,7 @@ dirl_entry(int fd, { struct stat stat_buf; char* path_buf = calloc(sizeof(char), strlen(res->path)+strlen(entry->d_name)); - strcat(path_buf, res->path); + strcat(path_buf, res->uri); strcat(path_buf, entry->d_name); lstat(path_buf, &stat_buf);