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

Diff for /src/usr.bin/tmux/format.c between version 1.305 and 1.306

version 1.305, 2022/06/21 09:30:01 version 1.306, 2022/06/27 09:14:49
Line 4606 
Line 4606 
 {  {
         struct format_tree      *ft = es->ft;          struct format_tree      *ft = es->ft;
         char                    *buf, *out, *name;          char                    *buf, *out, *name;
         const char              *ptr, *s;          const char              *ptr, *s, *style_end = NULL;
         size_t                   off, len, n, outlen;          size_t                   off, len, n, outlen;
         int                      ch, brackets;          int                      ch, brackets;
         char                     expanded[8192];          char                     expanded[8192];
Line 4701 
Line 4701 
                                 break;                                  break;
                         fmt += n + 1;                          fmt += n + 1;
                         continue;                          continue;
                   case '[':
                 case '#':                  case '#':
                         /*                          /*
                          * If ##[ (with two or more #s), then it is a style and                           * If ##[ (with two or more #s), then it is a style and
                          * can be left for format_draw to handle.                           * can be left for format_draw to handle.
                          */                           */
                         ptr = fmt;                          ptr = fmt - (ch == '[');
                         n = 2;                          n = 2 - (ch == '[');
                         while (*ptr == '#') {                          while (*ptr == '#') {
                                 ptr++;                                  ptr++;
                                 n++;                                  n++;
Line 4721 
Line 4722 
                                 memcpy(buf + off, fmt - 2, n + 1);                                  memcpy(buf + off, fmt - 2, n + 1);
                                 off += n + 1;                                  off += n + 1;
                                 fmt = ptr + 1;                                  fmt = ptr + 1;
                                   style_end = format_skip(fmt - 2, "]");
                                 continue;                                  continue;
                         }                          }
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
Line 4735 
Line 4737 
                         continue;                          continue;
                 default:                  default:
                         s = NULL;                          s = NULL;
                         if (ch >= 'A' && ch <= 'Z')                          if (fmt > style_end) { /* skip inside #[] */
                                 s = format_upper[ch - 'A'];                                  if (ch >= 'A' && ch <= 'Z')
                         else if (ch >= 'a' && ch <= 'z')                                          s = format_upper[ch - 'A'];
                                 s = format_lower[ch - 'a'];                                  else if (ch >= 'a' && ch <= 'z')
                                           s = format_lower[ch - 'a'];
                           }
                         if (s == NULL) {                          if (s == NULL) {
                                 while (len - off < 3) {                                  while (len - off < 3) {
                                         buf = xreallocarray(buf, 2, len);                                          buf = xreallocarray(buf, 2, len);

Legend:
Removed from v.1.305  
changed lines
  Added in v.1.306