[BACK]Return to ul.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ul

Diff for /src/usr.bin/ul/ul.c between version 1.20 and 1.21

version 1.20, 2016/01/18 17:34:26 version 1.21, 2016/03/26 08:59:29
Line 55 
Line 55 
 #define SUBSC   004     /* Dim | Ul */  #define SUBSC   004     /* Dim | Ul */
 #define UNDERL  010     /* Ul */  #define UNDERL  010     /* Ul */
 #define BOLD    020     /* Bold */  #define BOLD    020     /* Bold */
   #define INDET   040     /* Indeterminate: either Bold or Ul */
   
 int     must_use_uc, must_overstrike;  int     must_use_uc, must_overstrike;
 char    *CURS_UP, *CURS_RIGHT, *CURS_LEFT,  char    *CURS_UP, *CURS_RIGHT, *CURS_LEFT,
Line 266 
Line 267 
                         if (obuf[col].c_char == L'\0') {                          if (obuf[col].c_char == L'\0') {
                                 obuf[col].c_char = L'_';                                  obuf[col].c_char = L'_';
                                 obuf[col].c_width = 1;                                  obuf[col].c_width = 1;
                           } else if (obuf[col].c_char == L'_') {
                                   if (obuf[col - 1].c_mode & UNDERL)
                                           obuf[col].c_mode |= UNDERL | mode;
                                   else if (obuf[col - 1].c_mode & BOLD)
                                           obuf[col].c_mode |= BOLD | mode;
                                   else
                                           obuf[col].c_mode |= INDET | mode;
                         } else                          } else
                                 obuf[col].c_mode |= UNDERL | mode;                                  obuf[col].c_mode |= UNDERL | mode;
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
Line 325 
Line 333 
 {  {
         int lastmode, i;          int lastmode, i;
         int hadmodes = 0;          int hadmodes = 0;
   
           for (i = maxcol; i > 0; i--) {
                   if (obuf[i].c_mode & INDET) {
                           obuf[i].c_mode &= ~INDET;
                           if (i < maxcol && obuf[i + 1].c_mode & BOLD)
                                   obuf[i].c_mode |= BOLD;
                           else
                                   obuf[i].c_mode |= UNDERL;
                   }
           }
   
         lastmode = NORMAL;          lastmode = NORMAL;
         for (i = 1; i < maxcol; i++) {          for (i = 1; i < maxcol; i++) {

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21