From 75e5e9c3f7f9615ae2ee38a839aafbbe642a735a Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Mon, 12 Feb 2018 17:41:30 -0800 Subject: color.h: document and modernize header Add documentation explaining the functions in color.h. While at it, migrate the function `color_set` into grep.c, where the only callers are. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- grep.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'grep.c') diff --git a/grep.c b/grep.c index 3d7cd0e96f..834b8eb439 100644 --- a/grep.c +++ b/grep.c @@ -18,6 +18,11 @@ static void std_output(struct grep_opt *opt, const void *buf, size_t size) fwrite(buf, size, 1, stdout); } +static void color_set(char *dst, const char *color_bytes) +{ + xsnprintf(dst, COLOR_MAXLEN, "%s", color_bytes); +} + /* * Initialize the grep_defaults template with hardcoded defaults. * We could let the compiler do this, but without C99 initializers -- cgit v1.2.3