From 9657148ff2127c2af5c8b5c2b7eb4d5ec53c4e4e Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 21 Jan 2024 00:51:59 +0100 Subject: Only highlight matches when cflag is set --- src/grab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grab.c b/src/grab.c index bc86b8d..f0d9946 100644 --- a/src/grab.c +++ b/src/grab.c @@ -477,7 +477,7 @@ putm(struct sv sv, regmatch_t *rm, const char *filename) } else printf("%s%c", filename, sep); } - if (rm) { + if (cflag && rm) { fwrite(sv.p, 1, rm->rm_so, stdout); printf("\33[%sm%.*s\33[0m", ma, (int)(rm->rm_eo - rm->rm_so), sv.p + rm->rm_so); -- cgit v1.2.3