|
1 | 1 | #include "cache.h" |
2 | 2 | #include "color.h" |
3 | 3 |
|
4 | | -#define COLOR_RESET "\033[m" |
5 | | - |
6 | 4 | int git_use_color_default = 0; |
7 | 5 |
|
8 | 6 | static int parse_color(const char *name, int len) |
@@ -54,7 +52,7 @@ void color_parse_mem(const char *value, int value_len, const char *var, |
54 | 52 | int bg = -2; |
55 | 53 |
|
56 | 54 | if (!strncasecmp(value, "reset", len)) { |
57 | | - strcpy(dst, "\033[m"); |
| 55 | + strcpy(dst, GIT_COLOR_RESET); |
58 | 56 | return; |
59 | 57 | } |
60 | 58 |
|
@@ -175,7 +173,7 @@ static int color_vfprintf(FILE *fp, const char *color, const char *fmt, |
175 | 173 | r += fprintf(fp, "%s", color); |
176 | 174 | r += vfprintf(fp, fmt, args); |
177 | 175 | if (*color) |
178 | | - r += fprintf(fp, "%s", COLOR_RESET); |
| 176 | + r += fprintf(fp, "%s", GIT_COLOR_RESET); |
179 | 177 | if (trail) |
180 | 178 | r += fprintf(fp, "%s", trail); |
181 | 179 | return r; |
@@ -217,7 +215,7 @@ int color_fwrite_lines(FILE *fp, const char *color, |
217 | 215 | char *p = memchr(buf, '\n', count); |
218 | 216 | if (p != buf && (fputs(color, fp) < 0 || |
219 | 217 | fwrite(buf, p ? p - buf : count, 1, fp) != 1 || |
220 | | - fputs(COLOR_RESET, fp) < 0)) |
| 218 | + fputs(GIT_COLOR_RESET, fp) < 0)) |
221 | 219 | return -1; |
222 | 220 | if (!p) |
223 | 221 | return 0; |
|
0 commit comments