[Toybox] [PATCH] cpio: pad properly, decrement size

ibid.ag at gmail.com ibid.ag at gmail.com
Sun Mar 16 21:33:28 PDT 2014


cpio: pad after file properly; decrement file size so we don't get an
infinite loop.

This fixes the remaining bugs in cpio -o:
-whether to pad depends on if the pad size is 0, not directly on the size
of the file.
-we got stuck in an infinite loop due to never subtracting the bytes
that we read.
--
Depends on the last patch (infinite loop on EOF, archive devices, and
allow -it).
I've tested like so:
scripts/single.sh cpio
find ./ |./cpio -o |./cpio -it |wc -l
find ./ |wc -l

Since it displays no error while archiving 1599 files in a way it can
read, I figure it "works pretty well".

Thanks,
Isaac Dunham
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpio-padread.diff
Type: text/x-diff
Size: 911 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20140316/dbae0f4e/attachment-0006.diff>


More information about the Toybox mailing list