Thread (17 messages) flat view 17 messages, 5 authors, 2016-06-15

Re: [PATCH 4/5] grep: Colorize filename, line number, and separator

From: René Scharfe <hidden>
Date: 2016-06-15 22:48:22

Forgot one thing in my earlier reply:

Am 27.02.2010 05:57, schrieb Mark Lodato:
quoted hunk ↗ jump to hunk
@@ -548,12 +565,9 @@ static void show_line(struct grep_opt *opt, char *bol, char *eol,
 				break;
 
 			opt->output(opt, bol, match.rm_so);
-			opt->output(opt, opt->color_match,
-				    strlen(opt->color_match));
-			opt->output(opt, bol + match.rm_so,
-				    (int)(match.rm_eo - match.rm_so));
-			opt->output(opt, GIT_COLOR_RESET,
-				    strlen(GIT_COLOR_RESET));
+			output_color(opt, bol + match.rm_so,
+				     (int)(match.rm_eo - match.rm_so),
+				     opt->color_match);
The third parameter of output_color() (and of ->output(), so you didn't
introduce this, of course) is a size_t, so why cast to int?  Is a cast
needed at all?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help