[hackers] [st] Fix disabling of bold and fastblink || Michael Forney

From: <git_AT_suckless.org>
Date: Thu, 31 Jul 2014 11:32:35 +0200

commit b4dfa18124451f9ee29a0719ef36ffd58fae4477
Author: Michael Forney <mforney_AT_mforney.org>
Date: Sat Jul 26 00:48:15 2014 -0700

    Fix disabling of bold and fastblink
    
    According to ECMA-48¹ 8.3.117, an attribute value of 21 is "doubly
    underlined", while 22 is "normal colour or normal intensity (neither
    bold nor faint)".
    
    Additionally, 25 is "steady (not blinking)", which likely means neither
    slow blink nor fast blink.
    
    ¹: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
    
    Signed-off-by: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>

diff --git a/st.c b/st.c
index 546db41..0c917fd 100644
--- a/st.c
+++ b/st.c
_AT_@ -1718,11 +1718,8 @@ tsetattr(int *attr, int l) {
                 case 9:
                         term.c.attr.mode |= ATTR_STRUCK;
                         break;
- case 21:
- term.c.attr.mode &= ~ATTR_BOLD;
- break;
                 case 22:
- term.c.attr.mode &= ~ATTR_FAINT;
+ term.c.attr.mode &= ~(ATTR_BOLD | ATTR_FAINT);
                         break;
                 case 23:
                         term.c.attr.mode &= ~ATTR_ITALIC;
_AT_@ -1731,10 +1728,7 @@ tsetattr(int *attr, int l) {
                         term.c.attr.mode &= ~ATTR_UNDERLINE;
                         break;
                 case 25:
- term.c.attr.mode &= ~ATTR_BLINK;
- break;
- case 26:
- term.c.attr.mode &= ~ATTR_FASTBLINK;
+ term.c.attr.mode &= ~(ATTR_BLINK | ATTR_FASTBLINK);
                         break;
                 case 27:
                         term.c.attr.mode &= ~ATTR_REVERSE;
Received on Thu Jul 31 2014 - 11:32:35 CEST

This archive was generated by hypermail 2.3.0 : Thu Jul 31 2014 - 11:36:12 CEST