On Thu, 7 Sep 2006, Loic Tortay wrote:
> On 07/09/06, Otto Moerbeek <[EMAIL PROTECTED]> wrote:
>
> >
> > If anybody has access to a Solaris machine, I like to know what the
> > test does there.
> >
> > On Solaris 8, 9 and 10 machines, the test gives the same result:
> % echo "some text here" | /usr/xpg4/bin/egrep -x "" ; echo $status
> 1
> %
OK, thanks
Try this.
-Otto
Index: grep.c
===================================================================
RCS file: /cvs/src/usr.bin/grep/grep.c,v
retrieving revision 1.35
diff -u -p -r1.35 grep.c
--- grep.c 7 Mar 2006 20:59:56 -0000 1.35
+++ grep.c 7 Sep 2006 15:47:04 -0000
@@ -168,7 +168,7 @@ struct option long_options[] =
static void
add_pattern(char *pat, size_t len)
{
- if (len == 0 || matchall) {
+ if (!xflag && (len == 0 || matchall)) {
matchall = 1;
return;
}