From: Wilfried Göesgens Date: Tue, 9 Jun 2009 19:55:54 +0000 (+0000) Subject: * apply c2aad11cc2c74aa5be540b6ac9033f3af38ea143 by by Sam Liddicott: use stat()... X-Git-Tag: v7.86~1091 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;ds=sidebyside;h=75a47326865bbb69232c8b35be19a6e7b87c4838;p=citadel.git * apply c2aad11cc2c74aa5be540b6ac9033f3af38ea143 by by Sam Liddicott: use stat() to verify the filetype in case of DT_UNKNOWN --- 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... */