]> git.ipfire.org Git - thirdparty/git.git/blobdiff - color.c
parse_color: recognize "no$foo" to clear the $foo attribute
[thirdparty/git.git] / color.c
diff --git a/color.c b/color.c
index ae687929233a03d2601d1a2a08a55a8d192f6af1..e2a0a99164cf340eac0190974cad66eed335f547 100644 (file)
--- a/color.c
+++ b/color.c
@@ -124,9 +124,11 @@ static int parse_color(struct color *out, const char *name, int len)
 
 static int parse_attr(const char *name, int len)
 {
-       static const int attr_values[] = { 1, 2, 4, 5, 7 };
+       static const int attr_values[] = { 1, 2, 4, 5, 7,
+                                          22, 22, 24, 25, 27 };
        static const char * const attr_names[] = {
-               "bold", "dim", "ul", "blink", "reverse"
+               "bold", "dim", "ul", "blink", "reverse",
+               "nobold", "nodim", "noul", "noblink", "noreverse"
        };
        int i;
        for (i = 0; i < ARRAY_SIZE(attr_names); i++) {
@@ -238,7 +240,7 @@ int color_parse_mem(const char *value, int value_len, char *dst)
                        attr &= ~bit;
                        if (sep++)
                                *dst++ = ';';
-                       *dst++ = '0' + i;
+                       dst += sprintf(dst, "%d", i);
                }
                if (!color_empty(&fg)) {
                        if (sep++)