From 75a47326865bbb69232c8b35be19a6e7b87c4838 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Tue, 9 Jun 2009 19:55:54 +0000 Subject: [PATCH] * apply c2aad11cc2c74aa5be540b6ac9033f3af38ea143 by by Sam Liddicott: use stat() to verify the filetype in case of DT_UNKNOWN --- webcit/static.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/webcit/static.c b/webcit/static.c index cca82086e..0d538f1b3 100644 --- a/webcit/static.c +++ b/webcit/static.c @@ -123,6 +123,16 @@ int LoadStaticDir(const char *DirName, HashList *DirList, const char *RelDir) #endif d_without_ext = d_namelen; + if (filedir_entry->d_type == DT_UNKNOWN) { + struct stat s; + char path[PATH_MAX]; + snprintf(path, PATH_MAX, "%s/%s", + DirName, filedir_entry->d_name); + if (stat(path, &s) == 0) { + filedir_entry->d_type = IFTODT(s.st_mode); + } + } + if ((d_namelen > 1) && filedir_entry->d_name[d_namelen - 1] == '~') continue; /* Ignore backup files... */ -- 2.39.2