summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-05-21 12:02:55 +0000
committerWez Furlong <wez@php.net>2003-05-21 12:02:55 +0000
commitf41f376213e7f8c8d301cdf69336dc3e0833251c (patch)
treed2aee114ad1ee783ca3d7e8f70e2b7dbb9cc5c29
parentcbd712e8c970eb1e07f91f72e379050218beb98c (diff)
downloadphp-git-f41f376213e7f8c8d301cdf69336dc3e0833251c.tar.gz
Allow win32 people to fopen($filename, 'rt') to explicitly chose text-mode
files again. The functionality was accidentally dropped when we introduced our own fopen mode string parser.
-rwxr-xr-xmain/streams.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/streams.c b/main/streams.c
index 357894ef69..4d68335eae 100755
--- a/main/streams.c
+++ b/main/streams.c
@@ -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;