Fixed weirdness in os_char_width() carried over from old DOS interface.
authorDavid Griffith <dave@661.org>
Fri, 26 Jan 2018 12:55:45 +0000 (04:55 -0800)
committerDavid Griffith <dave@661.org>
Fri, 26 Jan 2018 12:55:45 +0000 (04:55 -0800)
src/curses/ux_text.c

index 60065324566a2259ef32b4e4547ecb706b48a32f..95228b320cbe74760a47181ecc957a4697ee6180 100644 (file)
@@ -277,14 +277,13 @@ int os_char_width (zchar c)
 
         int width = 0;
         const char *ptr = latin1_to_ascii + 3 * (c - ZC_LATIN1_MIN);
-       char c1 = *ptr++;
-       char c2 = *ptr++;
-       char c3 = *ptr++;
+       char c2, c3;
 
-       /* Why, oh, why did you declare variables that way??? */
+       ptr++;
+       c2 = *ptr++;
+       c3 = *ptr++;
 
-       if (c1 == c1)  /* let's avoid confusing the compiler (and me) */
-         width++;
+       width++;
        if (c2 != ' ')
          width++;
        if (c3 != ' ')