Fix path for root case
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
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.
This commit is contained in:
parent
66558aa615
commit
48db5eea1d
1 changed files with 1 additions and 1 deletions
2
dirl.c
2
dirl.c
|
@ -189,7 +189,7 @@ dirl_entry(int fd,
|
||||||
{
|
{
|
||||||
struct stat stat_buf;
|
struct stat stat_buf;
|
||||||
char* path_buf = calloc(sizeof(char), strlen(res->path)+strlen(entry->d_name));
|
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);
|
strcat(path_buf, entry->d_name);
|
||||||
lstat(path_buf, &stat_buf);
|
lstat(path_buf, &stat_buf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue