From 1e8a2e19b388164da10ece7b63648bfc3d66f537 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 6 Mar 2007 22:37:04 +0000 Subject: (svn r9043) -Fix [FS#652]: the personal (.openttd) directories were hidden in the load/save directory listings (stepancheg). --- src/os2.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/os2.cpp') diff --git a/src/os2.cpp b/src/os2.cpp index 88ca2fddf..7443e6896 100644 --- a/src/os2.cpp +++ b/src/os2.cpp @@ -114,11 +114,15 @@ bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb char filename[MAX_PATH]; 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] == '.'; } + static void ChangeWorkingDirectory(char *exe) { char *s = strrchr(exe, PATHSEPCHAR); -- cgit v1.2.3-54-g00ecf