1
0

applied Manuel's regex patch

This commit is contained in:
arg@mig29 2006-12-03 11:21:25 +01:00
parent 7739e6b466
commit c53d9d516a

6
tag.c
View File

@ -55,14 +55,14 @@ initrregs(void) {
for(i = 0; i < len; i++) { for(i = 0; i < len; i++) {
if(rule[i].clpattern) { if(rule[i].clpattern) {
reg = emallocz(sizeof(regex_t)); reg = emallocz(sizeof(regex_t));
if(regcomp(reg, rule[i].clpattern, 0)) if(regcomp(reg, rule[i].clpattern, REG_EXTENDED))
free(reg); free(reg);
else else
rreg[i].clregex = reg; rreg[i].clregex = reg;
} }
if(rule[i].tpattern) { if(rule[i].tpattern) {
reg = emallocz(sizeof(regex_t)); reg = emallocz(sizeof(regex_t));
if(regcomp(reg, rule[i].tpattern, 0)) if(regcomp(reg, rule[i].tpattern, REG_EXTENDED))
free(reg); free(reg);
else else
rreg[i].tregex = reg; rreg[i].tregex = reg;
@ -86,7 +86,7 @@ settags(Client *c, Client *trans) {
snprintf(prop, sizeof prop, "%s:%s:%s", snprintf(prop, sizeof prop, "%s:%s:%s",
ch.res_class ? ch.res_class : "", ch.res_class ? ch.res_class : "",
ch.res_name ? ch.res_name : "", c->name); ch.res_name ? ch.res_name : "", c->name);
for(i = 0; !matched && i < len; i++) for(i = 0; i < len; i++)
if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) { if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) {
c->isfloat = rule[i].isfloat; c->isfloat = rule[i].isfloat;
for(j = 0; rreg[i].tregex && j < ntags; j++) { for(j = 0; rreg[i].tregex && j < ntags; j++) {