return -1;
}
-void color_parse(const char *value, const char *var, char *dst)
+int color_parse(const char *value, char *dst)
{
- color_parse_mem(value, strlen(value), var, dst);
+ return color_parse_mem(value, strlen(value), dst);
}
-void color_parse_mem(const char *value, int value_len, const char *var,
- char *dst)
+int color_parse_mem(const char *value, int value_len, char *dst)
{
const char *ptr = value;
int len = value_len;
if (!strncasecmp(value, "reset", len)) {
strcpy(dst, GIT_COLOR_RESET);
- return;
+ return 0;
}
/* [fg [bg]] [attr]... */
*dst++ = 'm';
}
*dst = 0;
- return;
+ return 0;
bad:
- die("bad color value '%.*s' for variable '%s'", value_len, value, var);
+ return error(_("invalid color value: %.*s"), value_len, value);
}
int git_config_colorbool(const char *var, const char *value)