the tests were here but never merged: http://lists.landley.net/pipermail/toybox-landley.net/2017-April/008962.html
i did see the weird suffix addition stuff when i read the man page, but since it was (a) the first time i'd heard of it in 25 years and (b) disgusting, i thought i'd wait until someone actually needed it. likewise the ignoring errors. that seemed like a bug rather than a feature until proven otherwise. but, yeah, i should have said so in TODO comments. (i thought i did comment the former, but that may have been lost in the toybox obfuscated c competition rewrite.) On Wed, Jan 3, 2018 at 1:28 AM, Rob Landley <[email protected]> wrote: > Poking at this, did I break it or was it never particularly tested? > > $ ./zcat README > zcat: unknown suffix: README > $ cat README | ./gunzip | head -n 3 > Toybox: all-in-one Linux command line. > > --- Getting started > $ cat README | gunzip | head -n 3 > gzip: stdin: not in gzip format > > I was trying to see if gzdopen(blah, "r") verifies the gzip header on > the data stream and thus fails due to being fed non-gzip data, or if the > first read() does that. (I dug up the zlib manual which says it doesn't > use the filehandle until read so won't notice if it's invalid, so > failure there is basically a malloc failure.) > > Also, there's a lot of error_exit() calls when the old gzip continues to > the next argument instead: > > $ cat ../README | gzip > one.gz > $ cat ../README | gzip > two.gz > $ touch one > $ sudo chattr +i one > $ gunzip one.gz two.gz > gzip: one already exists; do you wish to overwrite (y or n)? y > gzip: one: Operation not permitted > $ ls -l > total 12 > -rw-rw-r-- 1 landley landley 0 Jan 3 03:22 one > -rw-rw-r-- 1 landley landley 3076 Jan 3 03:22 one.gz > -rw-rw-r-- 1 landley landley 6624 Jan 3 03:22 two > > And so on... > > Rob > _______________________________________________ > Toybox mailing list > [email protected] > http://lists.landley.net/listinfo.cgi/toybox-landley.net _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
