(svn r9043) -Fix [FS#652]: the personal (.openttd) directories were hidden in the load/save directory listings (stepancheg).

This commit is contained in:
rubidium
2007-03-06 22:37:04 +00:00
parent 7a58642b6c
commit 1e8a2e19b3
4 changed files with 21 additions and 8 deletions

View File

@@ -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 (ent->d_name[0] != '.'); // hidden file
return stat(filename, sb) == 0;
}
bool FiosIsHiddenFile(const struct dirent *ent)
{
return ent->d_name[0] == '.';
}
static void ChangeWorkingDirectory(char *exe)
{
char *s = strrchr(exe, PATHSEPCHAR);