]> git.ipfire.org Git - thirdparty/util-linux.git/commit
tailf: count last lines correctly at initial print out
authorSami Kerola <kerolasa@iki.fi>
Sun, 15 Feb 2015 16:52:39 +0000 (16:52 +0000)
committerKarel Zak <kzak@redhat.com>
Thu, 5 Mar 2015 09:31:18 +0000 (10:31 +0100)
commita260b21bdb7a1592523de41bb09a13f9f460684d
treeff4a80005f02cf225864dfc7e8a8a3f507d236cf
parent7e5dd0e5bed95f3da369a912732ab500c3c15c5f
tailf: count last lines correctly at initial print out

When last lines happen to be greater than string buffer size for fgets()
the number of printed lines resulted to too few.  To avoid miscounts due
insufficient buffer size use mmap() to map the whole file and rewind
until requested number of new lines is found.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/tailf.c