On Tue, Apr 17, 2012 at 10:25:03 +0200, Tino Keitel wrote:
> On Tue, Apr 17, 2012 at 10:23:28 +0200, Tino Keitel wrote:
> > On Tue, Apr 17, 2012 at 18:07:29 +1000, Aníbal Monsalve Salazar wrote:
> > > On Tue, Apr 17, 2012 at 09:23:58AM +0200, Tino Keitel wrote:
> > > >Package: grep
> > > >Version: 2.11-2
> > > >Severity: important
> > > >
> > > >grep does not match anything when reading from stdin. Reading from a file
> > > >works.
> > > >
> > > >$ echo foo > foo
> > > >$ grep . foo
> > > >foo
> > > >$ cat foo | grep .
> > > >$ echo foo | grep .
> > > >$ 
> > > 
> > > It works for me, please see below.
> 
> The version from testing (2.10-1) works here, too.

This snipset from the 2.11 main.c is very likely the culprit. The
'S_ISFIFO (stats->stat.st_mode)' causes stdin to be skipped if it is a
pipe.

if ((directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
    || (devices == SKIP_DEVICES && (S_ISCHR (stats->stat.st_mode)
                                    || S_ISBLK (stats->stat.st_mode)
                                    || S_ISSOCK (stats->stat.st_mode)
                                    || S_ISFIFO (stats->stat.st_mode))))
  {
    if (file)
      close (desc);
    return 1;
  }



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to