Github user jmuehlner commented on a diff in the pull request:

    
https://github.com/apache/incubator-guacamole-server/pull/86#discussion_r113608643
  
    --- Diff: src/terminal/display.c ---
    @@ -127,24 +104,27 @@ int __guac_terminal_hash_codepoint(int codepoint) {
     int __guac_terminal_set_colors(guac_terminal_display* display,
             guac_terminal_attributes* attributes) {
     
    -    int background, foreground;
    +    const guac_terminal_color* background;
    +    const guac_terminal_color* foreground;
     
         /* Handle reverse video */
         if (attributes->reverse != attributes->cursor) {
    -        background = attributes->foreground;
    -        foreground = attributes->background;
    +        background = &attributes->foreground;
    +        foreground = &attributes->background;
         }
         else {
    -        foreground = attributes->foreground;
    -        background = attributes->background;
    +        foreground = &attributes->foreground;
    +        background = &attributes->background;
         }
     
         /* Handle bold */
    -    if (attributes->bold && foreground <= 7)
    -        foreground += 8;
    +    if (attributes->bold && foreground->palette_index >= 0
    +            && foreground->palette_index <= 7) {
    +        foreground = &guac_terminal_palette[foreground->palette_index + 8];
    --- End diff --
    
    Constants that better explain what this 7 and 8 are about would make me 
happy.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to