summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-05-28 10:15:00 +0000
committerWez Furlong <wez@php.net>2003-05-28 10:15:00 +0000
commit1ebb0b07859c44976f205aaa3475126c9f608a07 (patch)
treec8d10265db49002b0d5e52f209fe531c49982316
parent01fa930e6b23e19c2de1f92fa835e3cac96aa7c2 (diff)
downloadphp-git-1ebb0b07859c44976f205aaa3475126c9f608a07.tar.gz
On win32, always open in binary mode unless they asked for text mode using 't'.
This solves a number of apparent BC breaks that resulted from the move from fopen() to open().
-rwxr-xr-xmain/streams.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/main/streams.c b/main/streams.c
index 47b007a170..4af3c21f8b 100755
--- a/main/streams.c
+++ b/main/streams.c
@@ -1912,14 +1912,11 @@ PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags)
flags |= O_RDONLY;
}
-#ifdef O_BINARY
- if (strchr(mode, 'b')) {
- flags |= O_BINARY;
- }
-#endif
-#ifdef _O_TEXT
+#if defined(_O_TEXT) && defined(O_BINARY)
if (strchr(mode, 't')) {
flags |= _O_TEXT;
+ } else {
+ flags |= O_BINARY;
}
#endif