From 5960af297c4c639742f349217d51fb59dd08d4af Mon Sep 17 00:00:00 2001 From: 0x221E Date: Sat, 17 Jan 2026 18:11:17 +0100 Subject: [PATCH] Patch: Add DT_UNKNOWN check to dir_get_recursive() --- src/io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/io.c b/src/io.c index 4bacafa..caf6c2c 100644 --- a/src/io.c +++ b/src/io.c @@ -39,7 +39,8 @@ size_t dir_get_recursive(DirOpContext* doc, StringView* p) if(de == NULL && errno != 0) DIE("failed to read directory: \"%s\"", p); if(de == NULL) break; - + + if(de->d_type == DT_UNKNOWN) DIE("Filesystem not supported!!"); if(de->d_type != DT_DIR && de->d_type != DT_REG) continue; if(strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0 || strcmp(de->d_name, ".git") == 0) continue; @@ -63,6 +64,7 @@ size_t dir_get_recursive(DirOpContext* doc, StringView* p) continue; } } + LOG_DEBUG("Directory complete: %s", p->buf); closedir(d); return count;