[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#16329: Acknowledgement (`head --lines=-0' prints nothing if no newli
From: |
Алексей Шилин |
Subject: |
bug#16329: Acknowledgement (`head --lines=-0' prints nothing if no newline at the EOF) |
Date: |
Sat, 04 Jan 2014 00:40:27 +0400 |
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.
--
Алексей Шилин
head_nlines_fix2.patch
Description: Source code patch