]> granicus.if.org Git - php/commitdiff
Allow win32 people to fopen($filename, 'rt') to explicitly chose text-mode
authorWez Furlong <wez@php.net>
Wed, 21 May 2003 12:02:55 +0000 (12:02 +0000)
committerWez Furlong <wez@php.net>
Wed, 21 May 2003 12:02:55 +0000 (12:02 +0000)
files again.

The functionality was accidentally dropped when we introduced our own fopen
mode string parser.

main/streams.c

index 357894ef699f47867958c077d81511a046116496..4d68335eae6b4ce769fbf720c38b9cbced931603 100755 (executable)
@@ -1916,6 +1916,11 @@ PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags)
                flags |= O_BINARY;
        }
 #endif
+#ifdef _O_TEXT
+       if (strchr(mode, 't')) {
+               flags |= _O_TEXT;
+       }
+#endif
 
        *open_flags = flags;
        return SUCCESS;