On 01/03/2014 08:40 PM, Алексей Шилин wrote: > Looks like I was overly cautious about decrementing an unsigned... > > size_t n = bytes_read; > while (n) > { > if (all_lines) > n -= n ? 1 : 0; // ...here. > else > > As it is under `while (n)' statement, n is always true here, and thus the ternary operator, though makes no > harm, is needless, and the whole line can be replaced with just `n--;'. Sorry for that. > > The fixed version of the original patch is attached. > I've updated the patch to also handle the pipe case, and I added a test. Will push soon. thanks, Pádraig.