Boost logo

Boost Users :

From: eg (egoots_at_[hidden])
Date: 2006-12-11 20:19:29


Mathieu Peyréga wrote:
>> I hope someone who has check-in privileges can look at this and
>> confirm/apply the patch before 1.34 gets released.
>
> I hope too... They could at least let us know what they think about this
> point... (as far as i'm concerned, the patch is applied on the boost
> sources i use)
>
> I saw that they prefer patch delivered in "patch" format, but i don't
> know how to do that (especially on a windows environnement...)

I think the following change should work as well AND it mimics the
copy_impl() function right below the one you changed... (i.e. the one
that does a "Copy from an indirect Source to a indirect Sink...")

It just moves the "if" statement up one line. So the while loop now
looks like:

while (!done) {
     streamsize amt;
     done = (amt = iostreams::read(src, buf.data(), buffer_size)) == -1;
     if (amt != -1) {
         std::copy(buf.data(), buf.data() + amt, p.first + total);
         total += amt;
     }
}

In any case, I have attached a patch file for this change if you want to
pass it on.


--- C:\dev\boost_1_33_1\boost\iostreams\copy.hpp Thu May 26 00:37:30 2005
+++ C:\dev\boost_1_33_1\boost\iostreams\Newcopy.hpp Mon Dec 11 17:14:34 2006
@@ -92,9 +92,10 @@
     while (!done) {
         streamsize amt;
         done = (amt = iostreams::read(src, buf.data(), buffer_size)) == -1;
- std::copy(buf.data(), buf.data() + amt, p.first + total);
- if (amt != -1)
+ if (amt != -1) {
+ std::copy(buf.data(), buf.data() + amt, p.first + total);
             total += amt;
+ }
     }
     return total;
 }


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net