From bb25748a9dfb150b5168af8bffb961335032db6c Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 26 Nov 2008 01:07:49 +0000 Subject: (svn r14635) -Change: use S_ISDIR/S_ISREG as x & S_IFREG always results false on platforms when S_IFREG is 0x0000. --- src/fileio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/fileio.cpp') diff --git a/src/fileio.cpp b/src/fileio.cpp index a4ba69cc2..f7b4a5af2 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -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, '.'); -- cgit v1.2.3-54-g00ecf