mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
(elide_tail_lines_pipe): Fix a thinko.
This sort of thing is why it'd be *Really Good* to factor out the common code used here and in tail.c.
This commit is contained in:
1 parent
23dbc2747d
commit
dadd6992a2
1 file changed
+3
-2
+3
-2
@@ -555,8 +555,9 @@ elide_tail_lines_pipe (const char *filename, int fd, uintmax_t n_elide)
|
||||
goto free_lbuffers;
|
||||
}
|
||||
|
||||
/* Count the incomplete line on files that don't end with a newline. */
|
||||
if (last->buffer[last->nbytes - 1] != '\n')
|
||||
/* If we read any bytes at all, count the incomplete line
|
||||
on files that don't end with a newline. */
|
||||
if (last->nbytes && last->buffer[last->nbytes - 1] != '\n')
|
||||
{
|
||||
++last->nlines;
|
||||
++total_lines;
|
||||
|
||||
Reference in new issue
Block a user