diff options
author | Stefan Beller <sbeller@google.com> | 2018-02-12 17:41:30 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-13 10:17:12 -0800 |
commit | 75e5e9c3f7f9615ae2ee38a839aafbbe642a735a (patch) | |
tree | c8c08c1f83c237daf0ed4d9f1c470f2eae145390 /grep.c | |
parent | Git 2.16.1 (diff) | |
download | tgif-75e5e9c3f7f9615ae2ee38a839aafbbe642a735a.tar.xz |
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>
Diffstat (limited to 'grep.c')
-rw-r--r-- | grep.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |