bsdgrep: revert color changes from r316477
r316477 changed the color output to match exactly the in-tree GNU grep, but introduces unnecessary escape sequences. Submitted by: Kyle Evans <kevans91 at ksu.edu> Reported by: ache MFC after: 1 month MFC with: r316477
This commit is contained in:
parent
9c2b99b912
commit
a5ed868511
@ -512,13 +512,13 @@ printline(struct str *line, int sep, regmatch_t *matches, int m)
|
||||
fwrite(line->dat + a, matches[i].rm_so - a, 1,
|
||||
stdout);
|
||||
if (color)
|
||||
fprintf(stdout, "\33[%sm", color);
|
||||
fprintf(stdout, "\33[%sm\33[K", color);
|
||||
|
||||
fwrite(line->dat + matches[i].rm_so,
|
||||
matches[i].rm_eo - matches[i].rm_so, 1,
|
||||
stdout);
|
||||
if (color)
|
||||
fprintf(stdout, "\33[00m\33[K");
|
||||
fprintf(stdout, "\33[m\33[K");
|
||||
a = matches[i].rm_eo;
|
||||
if (oflag)
|
||||
putchar('\n');
|
||||
|
Loading…
x
Reference in New Issue
Block a user