Re: [Toybox] [PATCH] Fix wc -c optimization.

2016-02-13 Thread Rob Landley
On 02/12/2016 10:16 AM, enh wrote: > Check the fstat(2) return value rather than read uninitialized memory if > it failed, and add a special case for files that claim to be zero-length > but aren't (as is common in /proc on Linux). > --- > toys/posix/wc.c | 4 ++-- > 1 file changed, 2

Re: [Toybox] [PATCH] Fix wc -c optimization.

2016-02-13 Thread enh
On Sat, Feb 13, 2016 at 8:37 AM, Rob Landley wrote: > On 02/12/2016 10:16 AM, enh wrote: >> Check the fstat(2) return value rather than read uninitialized memory if >> it failed, and add a special case for files that claim to be zero-length >> but aren't (as is common in /proc

[Toybox] [PATCH] Implement file(1).

2016-02-13 Thread enh
Unlike the POSIX file(1), there's no magic file here, just hard-coded common (non-obsolete) file formats. Personally most of my use of file(1) is as a one-line readelf(1) summarizer, so although I assume a full POSIX file(1) is out of scope (because just the database would likely be larger than

Re: [Toybox] [PATCH] Implement file(1).

2016-02-13 Thread Josiah Worcester
On Sat, Feb 13, 2016 at 9:56 AM enh wrote: > Unlike the POSIX file(1), there's no magic file here, just hard-coded > common (non-obsolete) file formats. Personally most of my use of file(1) > is as a one-line readelf(1) summarizer, so although I assume a full POSIX > file(1) is

Re: [Toybox] [PATCH] Implement file(1).

2016-02-13 Thread Isaac Dunham
On Sat, Feb 13, 2016 at 09:56:29AM -0800, enh wrote: > Unlike the POSIX file(1), there's no magic file here, just hard-coded > common (non-obsolete) file formats. Personally most of my use of file(1) > is as a one-line readelf(1) summarizer, so although I assume a full POSIX > file(1) is out of