Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'color.c')
-rw-r--r--color.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/color.c b/color.c
index a9eadd190a..7bb4a96f8c 100644
--- a/color.c
+++ b/color.c
@@ -207,10 +207,15 @@ int color_parse_mem(const char *value, int value_len, char *dst)
struct color fg = { COLOR_UNSPECIFIED };
struct color bg = { COLOR_UNSPECIFIED };
+ while (len > 0 && isspace(*ptr)) {
+ ptr++;
+ len--;
+ }
+
if (!len)
return -1;
- if (!strncasecmp(value, "reset", len)) {
+ if (!strncasecmp(ptr, "reset", len)) {
xsnprintf(dst, end - dst, GIT_COLOR_RESET);
return 0;
}