So should I revert the patch on HEAD then?

Moriyoshi

Wez Furlong <[EMAIL PROTECTED]> wrote:

> Actually, the return values throughout that function are all bogus...
> Don't worry about reverting (for 4.3).
> I'll add this to my TODO for PHP 5.
> 
> --Wez.
> 
> On Sat, 15 Feb 2003, Wez Furlong wrote:
> 
> > This is a bogus patch; the return value of the php_stream_copy_to_XXX
> > functions are the number of bytes that were copied, and this patch
> > breaks that.
> >
> > The correct fix for #22234 is to fix php_copy_file() to handle a 0
> > return from this function.
> >
> > Please revert!
> >
> > --Wez.
> >
> > On Sat, 15 Feb 2003, Moriyoshi Koizumi wrote:
> >
> > > 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
> > >
> > >
> > >
> >
> >
> > --
> > PHP CVS Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> 
> 
> -- 
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to