On Mon, Nov 27, 2023 at 07:10:26PM +, Pádraig Brady wrote:
> On 27/11/2023 16:24, dann frazier wrote:
> > * src/tail.c (file_lines): Use fstat() to determine a file's block
> > size and dynamically allocate a buffer of that size for traversing
> > backwards.
>
> Thanks for the patch.
> Could y
Changes from v1:
- Fallback to BUFSIZ if fstat fails instead of exiting.
- Add a comment block to explain why the blksize is used in file_lines()
(which I hope also clarifies why it is not needed elsewhere).
- Only use blksize if it is > BUFSIZ (I had regressed to 4K reads, oops).
- Update c