cvs: php4 /main streams.c
| From: | Ilia Alshanetsky | Date: | Tue, 22 Oct 2002 15:34:50 +0000 |
| Subject: | cvs: php4 /main streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-15149@lists.php.net to get a copy of this message | ||
iliaa Tue Oct 22 11:34:50 2002 EDT
Modified files:
/php4/main streams.c
Log:
When doing automatic line end detection, pick the line end that is found
first.
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.115 php4/main/streams.c:1.116
--- php4/main/streams.c:1.115 Mon Oct 21 18:54:37 2002
+++ php4/main/streams.c Tue Oct 22 11:34:50 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.115 2002/10/21 22:54:37 wez Exp $ */
+/* $Id: streams.c,v 1.116 2002/10/22 15:34:50 iliaa Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -644,8 +644,8 @@
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;