moriyoshi Sat Feb 15 14:56:13 2003 EDT
Modified files:
/php4/main streams.c
Log:
Fixed bug #22234
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.154 php4/main/streams.c:1.155
--- php4/main/streams.c:1.154 Thu Feb 13 16:08:04 2003
+++ php4/main/streams.c Sat Feb 15 14:56:12 2003
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.154 2003/02/13 21:08:04 wez Exp $ */
+/* $Id: streams.c,v 1.155 2003/02/15 19:56:12 moriyoshi Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -1206,6 +1206,17 @@
/* fall through - we might be able to copy in smaller chunks */
}
#endif
+
+ {
+ php_stream_statbuf sbuf;
+ if (php_stream_stat(src, &sbuf TSRMLS_CC) == 0) {
+ /* in the event that the source file is 0 bytes, return 1 to
+indicate success
+ * because opening the file to write had already created a
+copy */
+ if (sbuf.sb.st_size == 0) {
+ return 1;
+ }
+ }
+ }
while(1) {
readchunk = sizeof(buf);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php