Browse code

added nocase support for anchored hexsigs

Kevin Lin authored on 2015/02/12 03:20:07
Showing 1 changed files
... ...
@@ -1713,7 +1713,10 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1713 1713
                     break;
1714 1714
                 }
1715 1715
 
1716
-                new->ch[i] = *dec;
1716
+                if(nocase && ((*dec & CLI_MATCH_METADATA) == CLI_MATCH_CHAR))
1717
+                    new->ch[i] = cli_nocase(*dec) | CLI_MATCH_NOCASE;
1718
+                else
1719
+                    new->ch[i] = *dec;
1717 1720
                 free(dec);
1718 1721
                 new->ch_mindist[i] = n1;
1719 1722
                 new->ch_maxdist[i] = n2;
... ...
@@ -1726,7 +1729,10 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
1726 1726
                     break;
1727 1727
                 }
1728 1728
 
1729
-                new->ch[i] = *dec;
1729
+                if(nocase && ((*dec & CLI_MATCH_METADATA) == CLI_MATCH_CHAR))
1730
+                    new->ch[i] = cli_nocase(*dec) | CLI_MATCH_NOCASE;
1731
+                else
1732
+                    new->ch[i] = *dec;
1730 1733
                 free(dec);
1731 1734
                 new->ch_mindist[i] = n1;
1732 1735
                 new->ch_maxdist[i] = n2;