Re: [PATCH 1/2] Clean up use of ANSI color sequences

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Arjen Laarhoven <arjen@xxxxxxxx> writes:

> diff --git a/pretty.c b/pretty.c
> index cc460b5..a8595f6 100644
> --- a/pretty.c
> +++ b/pretty.c
> @@ -567,16 +567,16 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder,
>  			return end - placeholder + 1;
>  		}
>  		if (!prefixcmp(placeholder + 1, "red")) {
> -			strbuf_addstr(sb, "\033[31m");
> +			strbuf_addstr(sb, COLOR_RED);
>  			return 4;
>  		} else if (!prefixcmp(placeholder + 1, "green")) {
> -			strbuf_addstr(sb, "\033[32m");
> +			strbuf_addstr(sb, COLOR_GREEN);
>  			return 6;
>  		} else if (!prefixcmp(placeholder + 1, "blue")) {
> -			strbuf_addstr(sb, "\033[34m");
> +			strbuf_addstr(sb, COLOR_BLUE);
>  			return 5;
>  		} else if (!prefixcmp(placeholder + 1, "reset")) {
> -			strbuf_addstr(sb, "\033[m");
> +			strbuf_addstr(sb, COLOR_RESET);

These four are obviously bad and not even compile tested.

I'll fix them up when queuing.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux