]> granicus.if.org Git - php/commitdiff
On win32, always open in binary mode unless they asked for text mode using 't'.
authorWez Furlong <wez@php.net>
Wed, 28 May 2003 10:15:00 +0000 (10:15 +0000)
committerWez Furlong <wez@php.net>
Wed, 28 May 2003 10:15:00 +0000 (10:15 +0000)
This solves a number of apparent BC breaks that resulted from the move from
fopen() to open().

main/streams.c

index 47b007a17081c5f54a7a7a759e1255e893c771b5..4af3c21f8be94f1cb051473e3c130342dd3aa2f6 100755 (executable)
@@ -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