[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.216 and 1.217

version 1.216, 2019/11/25 15:02:48 version 1.217, 2019/11/25 15:04:15
Line 1299 
Line 1299 
                 }                  }
   
                 /* Now try single character with arguments. */                  /* Now try single character with arguments. */
                 if (strchr("mCs=", cp[0]) == NULL)                  if (strchr("mCs=p", cp[0]) == NULL)
                         break;                          break;
                 c = cp[0];                  c = cp[0];
   
Line 1565 
Line 1565 
         char                     *copy0, *condition, *found, *new;          char                     *copy0, *condition, *found, *new;
         char                     *value, *left, *right;          char                     *value, *left, *right;
         size_t                    valuelen;          size_t                    valuelen;
         int                       modifiers = 0, limit = 0, j;          int                       modifiers = 0, limit = 0, width = 0, j;
         struct format_modifier   *list, *fm, *cmp = NULL, *search = NULL;          struct format_modifier   *list, *fm, *cmp = NULL, *search = NULL;
         struct format_modifier  **sub = NULL;          struct format_modifier  **sub = NULL;
         u_int                     i, count, nsub = 0;          u_int                     i, count, nsub = 0;
Line 1611 
Line 1611 
                                 if (fm->argc >= 2 && fm->argv[1] != NULL)                                  if (fm->argc >= 2 && fm->argv[1] != NULL)
                                         marker = fm->argv[1];                                          marker = fm->argv[1];
                                 break;                                  break;
                           case 'p':
                                   if (fm->argc < 1)
                                           break;
                                   width = strtonum(fm->argv[0], INT_MIN, INT_MAX,
                                       &errptr);
                                   if (errptr != NULL)
                                           width = 0;
                                   break;
                         case 'l':                          case 'l':
                                 modifiers |= FORMAT_LITERAL;                                  modifiers |= FORMAT_LITERAL;
                                 break;                                  break;
Line 1843 
Line 1851 
                         value = new;                          value = new;
                 }                  }
                 format_log(ft, "applied length limit %d: %s", limit, value);                  format_log(ft, "applied length limit %d: %s", limit, value);
           }
   
           /* Pad the value if needed. */
           if (width > 0) {
                   new = utf8_padcstr(value, width);
                   free(value);
                   value = new;
                   format_log(ft, "applied padding width %d: %s", width, value);
           } else if (width < 0) {
                   new = utf8_rpadcstr(value, -width);
                   free(value);
                   value = new;
                   format_log(ft, "applied padding width %d: %s", width, value);
         }          }
   
         /* Expand the buffer and copy in the value. */          /* Expand the buffer and copy in the value. */

Legend:
Removed from v.1.216  
changed lines
  Added in v.1.217