=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/format.c,v retrieving revision 1.194 retrieving revision 1.195 diff -c -r1.194 -r1.195 *** src/usr.bin/tmux/format.c 2019/05/13 20:07:02 1.194 --- src/usr.bin/tmux/format.c 2019/05/25 16:51:10 1.195 *************** *** 1,4 **** ! /* $OpenBSD: format.c,v 1.194 2019/05/13 20:07:02 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: format.c,v 1.195 2019/05/25 16:51:10 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott *************** *** 1136,1148 **** /* * Modifiers are a ; separated list of the forms: ! * l,m,C,b,d,t,q,E,T,S,W,P * =a * =/a * =/a/ * s/a/b/ * s/a/b ! * ||,&&,!=,== */ *count = 0; --- 1136,1148 ---- /* * Modifiers are a ; separated list of the forms: ! * l,m,C,b,d,t,q,E,T,S,W,P,<,> * =a * =/a * =/a/ * s/a/b/ * s/a/b ! * ||,&&,!=,==,<=,>= */ *count = 0; *************** *** 1153,1159 **** cp++; /* Check single character modifiers with no arguments. */ ! if (strchr("lmCbdtqETSWP", cp[0]) != NULL && format_is_end(cp[1])) { format_add_modifier(&list, count, cp, 1, NULL, 0); cp++; --- 1153,1159 ---- cp++; /* Check single character modifiers with no arguments. */ ! if (strchr("lmCbdtqETSWP<>", cp[0]) != NULL && format_is_end(cp[1])) { format_add_modifier(&list, count, cp, 1, NULL, 0); cp++; *************** *** 1164,1170 **** if ((memcmp("||", cp, 2) == 0 || memcmp("&&", cp, 2) == 0 || memcmp("!=", cp, 2) == 0 || ! memcmp("==", cp, 2) == 0) && format_is_end(cp[2])) { format_add_modifier(&list, count, cp, 2, NULL, 0); cp += 2; --- 1164,1172 ---- 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) && format_is_end(cp[2])) { format_add_modifier(&list, count, cp, 2, NULL, 0); cp += 2; *************** *** 1433,1438 **** --- 1435,1442 ---- if (fm->size == 1) { switch (fm->modifier[0]) { case 'm': + case '<': + case '>': cmp = fm; break; case 'C': *************** *** 1486,1492 **** if (strcmp(fm->modifier, "||") == 0 || strcmp(fm->modifier, "&&") == 0 || strcmp(fm->modifier, "==") == 0 || ! strcmp(fm->modifier, "!=") == 0) cmp = fm; } } --- 1490,1498 ---- 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) cmp = fm; } } *************** *** 1549,1556 **** value = xstrdup("1"); else value = xstrdup("0"); ! } ! else if (strcmp(cmp->modifier, "m") == 0) { if (fnmatch(left, right, 0) == 0) value = xstrdup("1"); else --- 1555,1581 ---- 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, ">=") == 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) value = xstrdup("1"); else