Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/114'
Browse files Browse the repository at this point in the history
  • Loading branch information
hanatos committed Feb 5, 2024
2 parents 886eaa2 + 9bd6034 commit d2ecdd2
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/core/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down

0 comments on commit d2ecdd2

Please sign in to comment.