diff --git a/src/core/fs.h b/src/core/fs.h index 30e22809..b24c11ae 100644 --- a/src/core/fs.h +++ b/src/core/fs.h @@ -280,7 +280,19 @@ static inline int fs_islnk(const char *dirname, const struct dirent *e) #warning "port me!" return 0; #else - return e->d_type == DT_LNK; + if (e->d_type == DT_LNK) { + return 1; + } + else if (e->d_type == DT_UNKNOWN) { + char buf[512]; + strcpy(buf, dirname); + strcat(buf, "/"); + strcat(buf, e->d_name); + return fs_islnk_file(buf); + } + else { + return 0; + } #endif } @@ -306,7 +318,19 @@ static inline int fs_isreg(const char *dirname, const struct dirent *e) _stat64(filename, &buf); return (buf.st_mode & _S_IFREG) != 0; #else - return e->d_type == DT_REG; + if (e->d_type == DT_REG) { + return 1; + } + else if (e->d_type == DT_UNKNOWN) { + char buf[512]; + strcpy(buf, dirname); + strcat(buf, "/"); + strcat(buf, e->d_name); + return fs_isreg_file(buf); + } + else { + return 0; + } #endif }