summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fileio.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index 14c6401d3..5a917d086 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -297,7 +297,7 @@ FILE *FioFOpenFileSp(const char *filename, const char *mode, Searchpath sp, Subd
}
#if defined(WIN32)
- if (GetFileAttributes(OTTD2FS(buf)) == INVALID_FILE_ATTRIBUTES) return NULL;
+ if (mode[0] == 'r' && GetFileAttributes(OTTD2FS(buf)) == INVALID_FILE_ATTRIBUTES) return NULL;
#endif
f = fopen(buf, mode);