On 26 January 2011 17:53, Jim Meyering <[email protected]> wrote: > > Also, "make syntax-check" failed due to a useless <assert.h>
What's a good way to build that into my workflow (preferably without running it explicitly), e.g. getting make distcheck to do it? > Most importantly, non-seekable (pipe) input is not decompressed: > (that "null" looks suspicious, too) > > $ echo foo|gzip|src/grep --decompress o > src/grep: (null): Illegal seek > > It would sure be nice to fix that. This is a pain. The null is easy: I had misunderstood the format of the error() calls, and shouldn't've been passing file to error when file was null. The not seeking is harder. If transparent decompression is going to cope with pipes (and if not, one might as well just use a zgrep wrapper), then I can't seek in zio.c. But if I can't seek, then I can't check the magic by loading it in before calling a function like gzdopen. And gzdopen won't tell me whether it is actually uncompressing or not; and in any case, it will presumably read some data, so I will be left without a virgin descriptor that I can pass on to BZ2_bzdopen. In short, I can't think of a way to use the compression veneers to do what I want; it looks like I'll have to adapt them instead (so I can read the magic, check it, and then implement manual buffering to feed the relevant decompression function). This will take a bit of work, so before I start, any other suggestions welcomed. -- http://rrt.sc3d.org
