Skip to content

Commit 78f02df

Browse files
authored
pcre2grep: correctly convert colors in Windows (#247)
1 parent 04fbb65 commit 78f02df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pcre2grep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ Unix-style directory scanning can be used (see below). */
784784
#define iswild(name) (strpbrk(name, "*?") != NULL)
785785

786786
/* Convert ANSI BGR format to RGB used by Windows */
787-
#define BGR_RGB(x) ((x & 1 ? 4 : 0) | (x & 2) | (x & 4 ? 1 : 0))
787+
#define BGR_RGB(x) (((x) & 1 ? 4 : 0) | ((x) & 2) | ((x) & 4 ? 1 : 0))
788788

789789
static HANDLE hstdout;
790790
static CONSOLE_SCREEN_BUFFER_INFO csbi;

0 commit comments

Comments
 (0)