zgrep: fix shell portability bug with -f; fix mishandling of "-e -"
* tests/zgrep-f: Check for "zgrep -e -" bug, too.
* zgrep.in: Don't assume that if the shell redirects fd 6, then
this redirection is visible to the subsidiary grep. POSIX doesn't
guarantee this visibility except for file descriptors 0, 1, and 2,
and ksh does not support it. Problem reported by Thomas Schulz in
<http://lists.gnu.org/archive/html/bug-gzip/2010-11/msg00000.html>.
Also, fix a related bug: "-e -" was mishandled. These two bugs
were introduced by commit
5b54db4546b84ec97ff57a62f8ddb98faacf77f2
dated 2009-10-09.
(escape): Change the convention: do not assume that a stray X
is present at the end of the last line. All uses changed.
There was no longer any need for this convention, and fixing this
made it a bit easier to use 'sed' in a later part of the fix.