diff options
author | Elliott Hughes <enh@google.com> | 2019-03-29 13:39:41 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-03-29 13:39:41 -0700 |
commit | d4952191e4a16a7c29e0b2952d71fd86334bf48c (patch) | |
tree | 818308423a4b5cb604e41b2bba846102949d6e3a /toolbox/upstream-netbsd/usr.bin/grep/util.c | |
parent | f33436d7208e35f640d058f6cf9a1ca8b71d1849 (diff) | |
parent | 0b2474d84fba8c038d174ee13022d0234e2d1f1e (diff) |
Merge "BSD grep: sync with upstream." am: a42823b264 am: 1a420368d8
am: 0b2474d84f
Change-Id: I02cc77ba673fd298623f44164da7b2b0957d9000
Diffstat (limited to 'toolbox/upstream-netbsd/usr.bin/grep/util.c')
-rw-r--r-- | toolbox/upstream-netbsd/usr.bin/grep/util.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/toolbox/upstream-netbsd/usr.bin/grep/util.c b/toolbox/upstream-netbsd/usr.bin/grep/util.c index ecd948da4f..a3c9e4c30b 100644 --- a/toolbox/upstream-netbsd/usr.bin/grep/util.c +++ b/toolbox/upstream-netbsd/usr.bin/grep/util.c @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.17 2013/01/21 03:24:43 msaitoh Exp $ */ +/* $NetBSD: util.c,v 1.19 2018/02/05 22:14:26 mrg Exp $ */ /* $FreeBSD: head/usr.bin/grep/util.c 211496 2010-08-19 09:28:59Z des $ */ /* $OpenBSD: util.c,v 1.39 2010/07/02 22:18:03 tedu Exp $ */ @@ -34,7 +34,7 @@ #endif #include <sys/cdefs.h> -__RCSID("$NetBSD: util.c,v 1.17 2013/01/21 03:24:43 msaitoh Exp $"); +__RCSID("$NetBSD: util.c,v 1.19 2018/02/05 22:14:26 mrg Exp $"); #include <sys/stat.h> #include <sys/types.h> @@ -478,9 +478,10 @@ printline(struct str *line, int sep, regmatch_t *matches, int m) if (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); + fwrite(line->dat + matches[i].rm_so, + matches[i].rm_eo - matches[i].rm_so, 1, + stdout); + if (color) fprintf(stdout, "\33[m\33[K"); a = matches[i].rm_eo; |