From 2b903a77bd8d1dedd9f437f757666524bfc6e878 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 14 Aug 2020 06:31:19 +0200 Subject: [PATCH] really fix dt_dir on proxspace --- client/src/fileutils.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/fileutils.c b/client/src/fileutils.c index c55e7facb..4d6de8fd0 100644 --- a/client/src/fileutils.c +++ b/client/src/fileutils.c @@ -1464,7 +1464,12 @@ static int filelist(const char *path, const char *ext, uint8_t last, bool tentat for (uint16_t i = 0; i < n; i++) { - if (is_directory(namelist[i]->d_name)) { + char tmp_fullpath[1024] = {0}; + strcat(tmp_fullpath, path); + strcat(tmp_fullpath, namelist[i]->d_name); + + if (is_directory(tmp_fullpath)) { + char newpath[1024]; if (strcmp(namelist[i]->d_name, ".") == 0 || strcmp(namelist[i]->d_name, "..") == 0) continue; @@ -1472,6 +1477,7 @@ static int filelist(const char *path, const char *ext, uint8_t last, bool tentat snprintf(newpath, sizeof(newpath), "%s", path); strncat(newpath, namelist[i]->d_name, sizeof(newpath) - strlen(newpath)); strncat(newpath, "/", sizeof(newpath) - strlen(newpath)); + filelist(newpath, ext, last + ((i == n - 1) << (indent + 1)), tentative, indent + 1, strlen(path)); } else {