wez Mon Sep 23 22:46:39 2002 EDT
Modified files:
/php4/ext/standard file.c
Log:
Fix EOL markers for file() so that Mac EOL work correctly.
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.256 php4/ext/standard/file.c:1.257
--- php4/ext/standard/file.c:1.256 Mon Sep 23 14:12:38 2002
+++ php4/ext/standard/file.c Mon Sep 23 22:46:38 2002
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.256 2002/09/23 18:12:38 wez Exp $ */
+/* $Id: file.c,v 1.257 2002/09/24 02:46:38 wez Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -468,6 +468,7 @@
char *slashed, *target_buf;
register int i = 0;
int target_len, len;
+ char eol_marker = '\n';
zend_bool use_include_path = 0;
zend_bool reached_eof = 0;
php_stream *stream;
@@ -507,9 +508,14 @@
reached_eof = 1;
}
}
+
+ /* mini-hack because I don't feel like re-writing this whole function
+*/
+ if (stream->flags & PHP_STREAM_FLAG_EOL_MAC)
+ eol_marker = '\r';
+
if (!reached_eof) {
target_len += strlen(target_buf+target_len);
- if (target_buf[target_len-1] != '\n') {
+ if (target_buf[target_len-1] != eol_marker) {
continue;
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php