(svn r14635) -Change: use S_ISDIR/S_ISREG as x & S_IFREG always results false on platforms when S_IFREG is 0x0000.

This commit is contained in:
rubidium
2008-11-26 01:07:49 +00:00
parent c7a052200d
commit b0a9ce2d9a
2 changed files with 7 additions and 2 deletions

View File

@@ -984,12 +984,12 @@ static uint ScanPath(FileScanner *fs, const char *extension, const char *path, s
snprintf(filename, lengthof(filename), "%s%s", path, d_name);
if (sb.st_mode & S_IFDIR) {
if (S_ISDIR(sb.st_mode)) {
/* Directory */
if (strcmp(d_name, ".") == 0 || strcmp(d_name, "..") == 0) continue;
AppendPathSeparator(filename, lengthof(filename));
num += ScanPath(fs, extension, filename, basepath_length);
} else if (sb.st_mode & S_IFREG) {
} else if (S_ISREG(sb.st_mode)) {
/* File */
char *ext = strrchr(filename, '.');