X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=color.c;h=cb70340420b6285786b988d4a98d2023a37d4ffc;hb=b828fef678c21d017f18d2094bfdaac94e5fbf7a;hp=7bd424a8f6012859f40f2aa6210e7d4ce7686dc0;hpb=0f6f5a4022de5904926cd528c681468e3f635256;p=git.git diff --git a/color.c b/color.c index 7bd424a8f..cb7034042 100644 --- a/color.c +++ b/color.c @@ -17,7 +17,7 @@ static int parse_color(const char *name, int len) return i - 1; } i = strtol(name, &end, 10); - if (*name && !*end && i >= -1 && i <= 255) + if (end - name == len && i >= -1 && i <= 255) return i; return -2; } @@ -135,7 +135,7 @@ int git_config_colorbool(const char *var, const char *value, int stdout_is_tty) auto_color: if (stdout_is_tty < 0) stdout_is_tty = isatty(1); - if (stdout_is_tty || (pager_in_use && pager_use_color)) { + if (stdout_is_tty || (pager_in_use() && pager_use_color)) { char *term = getenv("TERM"); if (term && strcmp(term, "dumb")) return 1;