]> git.ipfire.org Git - thirdparty/tar.git/commit
Count short read slop when seeking
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Nov 2024 16:54:10 +0000 (09:54 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Nov 2024 20:43:05 +0000 (13:43 -0700)
commit15d35a0f61a516bdf946158daa8a6990a2191ce1
tree29a9e4b1c140b334d040c3d4d27f535c3550b0ee
parent04b4f491a8b3e774ab3ece194f25b23ab0095e6d
Count short read slop when seeking

* src/buffer.c (short_read_slop): New static var.
(get_archive_status): Treat anything other than fifos and sockets
as potentially seekable; they’ll tell us if they aren’t, whereas
fifos and sockets cannot be seekable.  Check named files for
initial offset too, to deal with names like /dev/stdin.
Do not worry about start_offset’s value if !seekable_archive,
as it won’t be used.  Use short_read_slop.
(short_read, try_new_volume, simple_flush_read, _gnu_flush_read):
Set short_read_slop.
src/buffer.c