aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-21 00:51:59 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-21 00:51:59 +0100
commit9657148ff2127c2af5c8b5c2b7eb4d5ec53c4e4e (patch)
treeacf9af82b450b504928eaf3a77e70868c1306bd8
parentaf4c619575b3ab268d90fdff4eabf8a5f4da1db6 (diff)
Only highlight matches when cflag is set
-rw-r--r--src/grab.c2
1 files changed, 1 insertions, 1 deletions
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);