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 <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
8279ed033f
commit
75e5e9c3f7
5
grep.c
5
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
|
||||
|
||||
Reference in New Issue
Block a user