summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fileio.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index fae920de2..140c9b2a7 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -296,6 +296,10 @@ FILE *FioFOpenFileSp(const char *filename, const char *mode, Searchpath sp, Subd
snprintf(buf, lengthof(buf), "%s%s%s", _searchpaths[sp], _subdirs[subdir], filename);
}
+#if defined(WIN32)
+ if (GetFileAttributes(OTTD2FS(buf)) == -1) return NULL;
+#endif
+
f = fopen(buf, mode);
#if !defined(WIN32)
if (f == NULL) {