[Toybox] [PATCH] tar: fix tvf for sparse extension headers.

Rob Landley rob at landley.net
Mon Sep 30 10:08:23 PDT 2019


I have so many open windows I didn't press "send" on. Trying to flush 'em...

On 9/17/19 6:38 PM, enh wrote:
> ping? (you submitted the test, but not the fix :-) )

Sorry, instead of:

$ diffstat ../0001-tar-fix-creation-of-tar-files-containing-sparse-file.patch
 tar.c |   26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

I went with:

$ git show | diffstat
 tar.c |   17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

Needed a bit more brain than I had at the time to work through it.

Rob

P.S. The TT.sparse allocation is retained and realloc()ed to the appropriate
size next time, freeing and reallocating it doesn't really help? It's hardly
ever a page. Does using a local variable instead of incrementing the final
variable each time produce noticeably smaller code? I'd think the optimizer
could notice that, it's doing so much else ridiculous lifetime analysis these
days you need to stick barriers in stuff to _stop_ it. And declaring another i
when there's already an i in the enclosing context is uncomfortable, and it was
free to use anyway between determining link type on line 267 and iterating
through the extent overflow blocks on on 349.

P.P.S. I _really_ should have called this project dorodango.



More information about the Toybox mailing list