zgrep: portability improvements; exercise "-f -"
authorJim Meyering <meyering@redhat.com>
Fri, 9 Oct 2009 18:03:09 +0000 (20:03 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 9 Oct 2009 18:15:50 +0000 (20:15 +0200)
commitbeb6a3e7a74a0415826752b25d418d2b54f3d49f
tree50e4e5176f062645b0086b4e9241365c743e89fd
parent5b54db4546b84ec97ff57a62f8ddb98faacf77f2
zgrep: portability improvements; exercise "-f -"

* zgrep.in: Adjust loop not to use seq; it's not portable enough.
Fail if we don't find a free file descriptor.
(exists): New function; Use it in place of less portable "test -e".
Testing for existence of /dev/fd/$fd doesn't work on Solaris 10,
since all 256 always exist (as char devices), but testing for
/proc/$$/fd/$fd does work, so do that instead.
* Makefile.am (TESTS): Add tests/zgrep-f.
* tests/zgrep-f: New test; exercise this bug.
* NEWS (Bug fixes): Mention it.
Makefile.am
NEWS
tests/zgrep-f [new file with mode: 0644]
zgrep.in