[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.194 and 1.195

version 1.194, 2019/05/13 20:07:02 version 1.195, 2019/05/25 16:51:10
Line 1136 
Line 1136 
   
         /*          /*
          * Modifiers are a ; separated list of the forms:           * Modifiers are a ; separated list of the forms:
          *      l,m,C,b,d,t,q,E,T,S,W,P           *      l,m,C,b,d,t,q,E,T,S,W,P,<,>
          *      =a           *      =a
          *      =/a           *      =/a
          *      =/a/           *      =/a/
          *      s/a/b/           *      s/a/b/
          *      s/a/b           *      s/a/b
          *      ||,&&,!=,==           *      ||,&&,!=,==,<=,>=
          */           */
   
         *count = 0;          *count = 0;
Line 1153 
Line 1153 
                         cp++;                          cp++;
   
                 /* Check single character modifiers with no arguments. */                  /* Check single character modifiers with no arguments. */
                 if (strchr("lmCbdtqETSWP", cp[0]) != NULL &&                  if (strchr("lmCbdtqETSWP<>", cp[0]) != NULL &&
                     format_is_end(cp[1])) {                      format_is_end(cp[1])) {
                         format_add_modifier(&list, count, cp, 1, NULL, 0);                          format_add_modifier(&list, count, cp, 1, NULL, 0);
                         cp++;                          cp++;
Line 1164 
Line 1164 
                 if ((memcmp("||", cp, 2) == 0 ||                  if ((memcmp("||", cp, 2) == 0 ||
                     memcmp("&&", cp, 2) == 0 ||                      memcmp("&&", cp, 2) == 0 ||
                     memcmp("!=", cp, 2) == 0 ||                      memcmp("!=", cp, 2) == 0 ||
                     memcmp("==", cp, 2) == 0) &&                      memcmp("==", cp, 2) == 0 ||
                       memcmp("<=", cp, 2) == 0 ||
                       memcmp(">=", cp, 2) == 0) &&
                     format_is_end(cp[2])) {                      format_is_end(cp[2])) {
                         format_add_modifier(&list, count, cp, 2, NULL, 0);                          format_add_modifier(&list, count, cp, 2, NULL, 0);
                         cp += 2;                          cp += 2;
Line 1433 
Line 1435 
                 if (fm->size == 1) {                  if (fm->size == 1) {
                         switch (fm->modifier[0]) {                          switch (fm->modifier[0]) {
                         case 'm':                          case 'm':
                           case '<':
                           case '>':
                                 cmp = fm;                                  cmp = fm;
                                 break;                                  break;
                         case 'C':                          case 'C':
Line 1486 
Line 1490 
                         if (strcmp(fm->modifier, "||") == 0 ||                          if (strcmp(fm->modifier, "||") == 0 ||
                             strcmp(fm->modifier, "&&") == 0 ||                              strcmp(fm->modifier, "&&") == 0 ||
                             strcmp(fm->modifier, "==") == 0 ||                              strcmp(fm->modifier, "==") == 0 ||
                             strcmp(fm->modifier, "!=") == 0)                              strcmp(fm->modifier, "!=") == 0 ||
                               strcmp(fm->modifier, ">=") == 0 ||
                               strcmp(fm->modifier, "<=") == 0)
                                 cmp = fm;                                  cmp = fm;
                 }                  }
         }          }
Line 1549 
Line 1555 
                                 value = xstrdup("1");                                  value = xstrdup("1");
                         else                          else
                                 value = xstrdup("0");                                  value = xstrdup("0");
                 }                  } else if (strcmp(cmp->modifier, "<") == 0) {
                 else if (strcmp(cmp->modifier, "m") == 0) {                          if (strcmp(left, right) < 0)
                                   value = xstrdup("1");
                           else
                                   value = xstrdup("0");
                   } else if (strcmp(cmp->modifier, ">") == 0) {
                           if (strcmp(left, right) > 0)
                                   value = xstrdup("1");
                           else
                                   value = xstrdup("0");
                   } else if (strcmp(cmp->modifier, "<=") == 0) {
                           if (strcmp(left, right) <= 0)
                                   value = xstrdup("1");
                           else
                                   value = xstrdup("0");
                   } else if (strcmp(cmp->modifier, ">=") == 0) {
                           if (strcmp(left, right) >= 0)
                                   value = xstrdup("1");
                           else
                                   value = xstrdup("0");
                   } else if (strcmp(cmp->modifier, "m") == 0) {
                         if (fnmatch(left, right, 0) == 0)                          if (fnmatch(left, right, 0) == 0)
                                 value = xstrdup("1");                                  value = xstrdup("1");
                         else                          else

Legend:
Removed from v.1.194  
changed lines
  Added in v.1.195