summaryrefslogtreecommitdiff
path: root/src/win32.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-03-06 22:37:04 +0000
committerrubidium <rubidium@openttd.org>2007-03-06 22:37:04 +0000
commit1e8a2e19b388164da10ece7b63648bfc3d66f537 (patch)
tree187a1ab0d77bb0b032920f496fa1a9c6dcac5bcc /src/win32.cpp
parent7a58642b6cf4ae602a55d9bbf4b1c730f7ef513f (diff)
downloadopenttd-1e8a2e19b388164da10ece7b63648bfc3d66f537.tar.xz
(svn r9043) -Fix [FS#652]: the personal (.openttd) directories were hidden in the load/save directory listings (stepancheg).
Diffstat (limited to 'src/win32.cpp')
-rw-r--r--src/win32.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/win32.cpp b/src/win32.cpp
index e6a4f6a27..032196d32 100644
--- a/src/win32.cpp
+++ b/src/win32.cpp
@@ -749,7 +749,6 @@ bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb
// hectonanoseconds between Windows and POSIX epoch
static const int64 posix_epoch_hns = 0x019DB1DED53E8000LL;
const WIN32_FIND_DATAW *fd = &ent->dir->fd;
- if (fd->dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)) return false;
sb->st_size = ((uint64) fd->nFileSizeHigh << 32) + fd->nFileSizeLow;
/* UTC FILETIME to seconds-since-1970 UTC
@@ -763,6 +762,11 @@ bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb
return true;
}
+bool FiosIsHiddenFile(const struct dirent *ent)
+{
+ return (ent->dir->fd.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)) != 0;
+}
+
bool FiosGetDiskFreeSpace(const char *path, uint32 *tot)
{
UINT sem = SetErrorMode(SEM_FAILCRITICALERRORS); // disable 'no-disk' message box