A small bash session which demonstrates the problem. $ mkdir test $ cd test $ echo asdf > m.cpp $ echo asdf > m.html $ grep -nr --include=*.cpp --include=*.c "asd" * m.html:1:asdf $ Reproducible: Always $ grep --version GNU grep 2.6.3 $ paludis -q grep * sys-apps/grep layman: (2.5.1a-r2 (in ::drizzt-overlay))X {:0} gentoo: 2.5.4-r1 2.6.3(~) {:0} installed: 2.6.3* {:0} Description: GNU regular expression matcher Homepage: http://www.gnu.org/software/grep/ License: GPL-3 Installed time: Fri Sep 03 12:41:28 MSD 2010 Use flags: (-nls) (pcre) Build Options: -trace From repositories: gentoo Installed using: paludis-0.54.2 $ gcc --version gcc (Gentoo 4.4.4-r1 p1.0, pie-0.4.5) 4.4.4
Created attachment 245839 [details] paludis --info sys-apps/grep
this appears to be fixed already in grep-2.6.4. so unless you feel like tracking down the commit that fixed this, i'll just wait for the next release.
grep-2.7 now in the tree