summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-09-25 14:15:38 +0000
committerglx <glx@openttd.org>2007-09-25 14:15:38 +0000
commit94a710fa46511d63ecd211e99d17f76e53497261 (patch)
treef7331867a0289c34228f1d76fef56ef3ab23f132
parente61f197dbaff79ff43244ab99d70009143a66e39 (diff)
downloadopenttd-94a710fa46511d63ecd211e99d17f76e53497261.tar.xz
(svn r11159) -Fix (r11155): restore the ability to save in a non existing file
-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);