[Toybox] [PATCH] file(1) should recognize gzip data too.

enh enh at google.com
Mon Apr 3 14:10:12 PDT 2017


On Mon, Apr 3, 2017 at 2:52 PM, Rob Landley <rob at landley.net> wrote:

> // GNU file shows the source OS and timestamp too but busybox and toybox
> // leave those unknown/blank, so reporting them isn't obviously useful.
>
> Busybox hasn't got "file". I agree reporting them isn't obviously
> useful, but I think I'm yanking the comment (or at least moving it to
> the checkin comment).
>

i meant "busybox and toybox [when generating gzip data] leave those
unknown/blank".


> And while we're at it, in zip detection...
>
>     int ver = (int)(char)(toybuf[4]);
>
> A double typecast is never a good sign, but here we compile with
> -funsigned-char (for consistency across architectures) which toybuf[4]
> already _is_ an instance of so... what is this doing? Did they mean to
> typecast it to (signed char) and then... llvm complained maybe? Can the
> zip version be negative?
>
> I'm confused!


me too. the rest of the code uses peek_le/peek_be for that kind of thing.

830f2561 toys/pending/file.c (Isaac Dunham   2016-02-29 11:29:21 -0600 247)
    int ver = (int)(char)(toybuf[4]);



>
> Rob
>



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170403/93ae4b66/attachment.htm>


More information about the Toybox mailing list