summaryrefslogtreecommitdiff
path: root/src/fileio.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-05 18:02:04 +0000
committerrubidium <rubidium@openttd.org>2008-12-05 18:02:04 +0000
commitbcb9a11754c7bd6314bc7803ee0d9d9127884d9d (patch)
tree99f8e7488b3857635aa25f629ba172220363dbe5 /src/fileio.cpp
parent1b91ec49c8742f9143d380c8cc3503effa5440e6 (diff)
downloadopenttd-bcb9a11754c7bd6314bc7803ee0d9d9127884d9d.tar.xz
(svn r14656) -Change: replace instances of x & S_IFREG with S_ISREG(x) as S_IFREG can be 0 on some platforms.
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r--src/fileio.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index 0e2d4d895..f4daaaa59 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -711,12 +711,12 @@ static int ScanPathForTarFiles(const char *path, size_t basepath_length)
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 += ScanPathForTarFiles(filename, basepath_length);
- } else if (sb.st_mode & S_IFREG) {
+ } else if (S_ISREG(sb.st_mode)) {
/* File */
char *ext = strrchr(filename, '.');