aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/w32console.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/w32console.c b/src/w32console.c
index 2774a7c842a..b1514f960b7 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -517,12 +517,15 @@ w32_face_attributes (f, face_id)
517 if (NILP (Vtty_defined_color_alist)) 517 if (NILP (Vtty_defined_color_alist))
518 return char_attr; 518 return char_attr;
519 519
520 if (face->foreground >= 0 520 /* Colors should be in the range 0...15 unless they are one of
521 && face->foreground < 16) 521 FACE_TTY_DEFAULT_COLOR, FACE_TTY_DEFAULT_FG_COLOR or
522 FACE_TTY_DEFAULT_BG_COLOR. Other out of range colors are
523 invalid, so it is better to use the default color if they ever
524 get through to here. */
525 if (face->foreground >= 0 && face->foreground < 16)
522 char_attr = (char_attr & 0xfff0) + face->foreground; 526 char_attr = (char_attr & 0xfff0) + face->foreground;
523 527
524 if (face->background >= 0 528 if (face->background >= 0 && face->background < 16)
525 && face->background < 16)
526 char_attr = (char_attr & 0xff0f) + (face->background << 4); 529 char_attr = (char_attr & 0xff0f) + (face->background << 4);
527 530
528 return char_attr; 531 return char_attr;