cvs: ZendEngine2 / zend_stream.c
| From: | Arnaud Le Blanc | Date: | Wed, 10 Sep 2008 10:15:58 +0000 |
| Subject: | cvs: ZendEngine2 / zend_stream.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-7119@lists.php.net to get a copy of this message | ||
lbarnaud Wed Sep 10 10:15:58 2008 UTC
Modified files:
/ZendEngine2 zend_stream.c
Log:
Fixed #45928 (large scripts from stdin are stripped at 16K border)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_stream.c?r1=1.22&r2=1.23&diff_format=u
Index: ZendEngine2/zend_stream.c
diff -u ZendEngine2/zend_stream.c:1.22 ZendEngine2/zend_stream.c:1.23
--- ZendEngine2/zend_stream.c:1.22 Fri Aug 15 19:45:25 2008
+++ ZendEngine2/zend_stream.c Wed Sep 10 10:15:58 2008
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_stream.c,v 1.22 2008/08/15 19:45:25 felipe Exp $ */
+/* $Id: zend_stream.c,v 1.23 2008/09/10 10:15:58 lbarnaud Exp $ */
#include "zend.h"
@@ -51,6 +51,11 @@
{
struct stat buf;
if (handle && fstat(fileno((FILE*)handle), &buf) == 0) {
+#ifdef S_ISREG
+ if (!S_ISREG(buf.st_mode)) {
+ return 0;
+ }
+#endif
return buf.st_size;
}
return 0;
@@ -96,6 +101,11 @@
return file_handle->handle.stream.fsizer(file_handle->handle.stream.handle TSRMLS_CC);
}
if (file_handle->handle.fp && fstat(fileno(file_handle->handle.fp), &buf) == 0)
{
+#ifdef S_ISREG
+ if (!S_ISREG(buf.st_mode)) {
+ return 0;
+ }
+#endif
return buf.st_size;
}