diff options
author | rubidium <rubidium@openttd.org> | 2007-03-06 22:37:04 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-03-06 22:37:04 +0000 |
commit | b6d5f6f74696f5ac62093dce1454249a4c25f578 (patch) | |
tree | 187a1ab0d77bb0b032920f496fa1a9c6dcac5bcc /src/unix.cpp | |
parent | 4445faba29b97baa7d8751c7df33c0a4eb4c187e (diff) | |
download | openttd-b6d5f6f74696f5ac62093dce1454249a4c25f578.tar.xz |
(svn r9043) -Fix [FS#652]: the personal (.openttd) directories were hidden in the load/save directory listings (stepancheg).
Diffstat (limited to 'src/unix.cpp')
-rw-r--r-- | src/unix.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/unix.cpp b/src/unix.cpp index 68b96ee39..d4b3899ba 100644 --- a/src/unix.cpp +++ b/src/unix.cpp @@ -92,9 +92,12 @@ bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb #endif snprintf(filename, lengthof(filename), "%s" PATHSEP "%s", path, ent->d_name); - if (stat(filename, sb) != 0) return false; + return stat(filename, sb) == 0; +} - return (ent->d_name[0] != '.'); // hidden file +bool FiosIsHiddenFile(const struct dirent *ent) +{ + return ent->d_name[0] == '.'; } #if defined(__BEOS__) || defined(__linux__) |