cvs: php4 /main streams.c
| From: | James Cox | Date: | Fri, 09 Aug 2002 00:33:06 +0000 |
| Subject: | cvs: php4 /main streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13230@lists.php.net to get a copy of this message | ||
imajes Thu Aug 8 20:33:06 2002 EDT
Modified files:
/php4/main streams.c
Log:
@Copy() fixed to return 1 on 0 byte files. Patch by Ilia A <ilia@prohost.org>.
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.57 php4/main/streams.c:1.58
--- php4/main/streams.c:1.57 Tue Jun 18 20:31:30 2002
+++ php4/main/streams.c Thu Aug 8 20:33:06 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.57 2002/06/19 00:31:30 edink Exp $ */
+/* $Id: streams.c,v 1.58 2002/08/09 00:33:06 imajes Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -473,6 +473,12 @@
if (fstat(srcfd, &sbuf) == 0) {
void *srcfile;
+
+ /* 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.st_size ==0)
+ return 1;
if (maxlen > sbuf.st_size || maxlen == 0)
maxlen = sbuf.st_size;