cvs: ZendEngine2(PHP_5_3) / zend_stream.c

[email protected] ("Arnaud Le Blanc")
Newsgroups php.zend-engine.cvs
Message-ID <cvslbarnaud1221042519@cvsserver>
lbarnaud		Wed Sep 10 10:28:39 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend_stream.c 
  Log:
  MFH: Fixed #45928 (large scripts from stdin are stripped at 16K border)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_stream.c?r1=1.13.2.1.2.1.2.6&r2=1.13.2.1.2.1.2.7&diff_format=u
Index: ZendEngine2/zend_stream.c
diff -u ZendEngine2/zend_stream.c:1.13.2.1.2.1.2.6 ZendEngine2/zend_stream.c:1.13.2.1.2.1.2.7
--- ZendEngine2/zend_stream.c:1.13.2.1.2.1.2.6	Fri Aug 15 19:47:28 2008
+++ ZendEngine2/zend_stream.c	Wed Sep 10 10:28:39 2008
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_stream.c,v 1.13.2.1.2.1.2.6 2008/08/15 19:47:28 felipe Exp $ */
+/* $Id: zend_stream.c,v 1.13.2.1.2.1.2.7 2008/09/10 10:28:39 lbarnaud Exp $ */
 
 
 #include "zend.h"
@@ -49,6 +49,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;
@@ -93,6 +98,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;
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.