Skip to content

Commit

Permalink
objdump: fix extended (256) disassembler colors
Browse files Browse the repository at this point in the history
After commit:

  commit a88c79b
  Date:   Tue Aug 9 14:57:48 2022 +0100

      Default to enabling colored disassembly if output is to a terminal.

The 256 extended-color support for --disassembler-color was broken.
This is fixed in this commit.

	PR 29457
	* objdump (objdump_styled_sprintf): Check disassembler_color
	against an enum value, don't treat it as a bool.
  • Loading branch information
T-J-Teru committed Aug 10, 2022
1 parent f805321 commit daf2618
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion binutils/objdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -2247,7 +2247,7 @@ objdump_styled_sprintf (SFILE *f, enum disassembler_style style,
{
size_t space = f->alloc - f->pos;

if (disassembler_color)
if (disassembler_color == on)
n = snprintf (f->buffer + f->pos, space, "\033[%dm", color);
else
n = snprintf (f->buffer + f->pos, space, "\033[38;5;%dm", color);
Expand Down

0 comments on commit daf2618

Please sign in to comment.