This might introduce some confusion and bad decisions into everyday administration: grep-2.14 with '--colour=auto' (the default in Gentoo) causes the last letter of the matched pattern disappear from output when that letter were to be the last on a terminal's line at the same time. Tested with xterm, aterm and mlterm, default settings, a different font for each. Tested on two plaintext files as input and on 'cat file|grep'. img1: a plain cat and alias settings. img2: the "c" disappears, because it is the last letter of the match pattern and last on a line (although the whole pattern is correctly matched) img3: when the pattern spans across two lines, nothing bad happens img4: another instance of the last letter of pattern disappearing img5: nothing bad happens at the beginning of a line img6: when the pattern doesn't reach to the end of a line, nothing bad happens Reproducible: Always
Created attachment 348768 [details] emerge --info xterm grep
Created attachment 348770 [details] images A Czech proverb says: "A good picture speaks a thousand ..." ... ah, nevermind.
When I unalias grep, the bug is gone. BTW, the bug happens with a 3.8 kernel too, not just 3.9.:)
I get the same bug on a x86, non-hardened box. The bug is present with USE="-pcre -nls" too.
i'm not sure this will ever really get fixed ... it's a crap situation. see this for more info: http://git.savannah.gnu.org/cgit/grep.git/tree/src/main.c?id=88d65410f7aa472c66da1bdf01c3cc1439cefce6#n142 you should be able to workaround it by doing: export GREP_COLORS=ne in your ~/.bash_profile or wherever