diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2002-10-22 15:34:50 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2002-10-22 15:34:50 +0000 |
| commit | a5d34272516754c8970a0f465341a8dd7d6b5b2a (patch) | |
| tree | 7611fd72b25167bb84771001fb8cee3398c92f69 /main/streams.c | |
| parent | dd56de8d1e15e1f950fb8c9d9e89aa623679c251 (diff) | |
| download | php-git-a5d34272516754c8970a0f465341a8dd7d6b5b2a.tar.gz | |
When doing automatic line end detection, pick the line end that is found
first.
Diffstat (limited to 'main/streams.c')
| -rwxr-xr-x | main/streams.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/streams.c b/main/streams.c index e288445b3b..d5e3123052 100755 --- a/main/streams.c +++ b/main/streams.c @@ -644,8 +644,8 @@ PHPAPI char *php_stream_locate_eol(php_stream *stream, char *buf, size_t buf_len if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL) { cr = memchr(readptr, '\r', avail); lf = memchr(readptr, '\n', avail); - - if (cr && lf != cr + 1) { + + if (cr && lf != cr + 1 && !(lf && lf < cr)) { /* mac */ stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; stream->flags |= PHP_STREAM_FLAG_EOL_MAC; |
