dwm-meillo

diff tag.c @ 609:dcbbfabc8ecc

applied Manuel's regex patch
author arg@mig29
date Sun, 03 Dec 2006 11:21:25 +0100
parents f7dcd3ac8d6f
children c7f84f23ec5a
line diff
     1.1 --- a/tag.c	Fri Dec 01 17:55:46 2006 +0100
     1.2 +++ b/tag.c	Sun Dec 03 11:21:25 2006 +0100
     1.3 @@ -55,14 +55,14 @@
     1.4  	for(i = 0; i < len; i++) {
     1.5  		if(rule[i].clpattern) {
     1.6  			reg = emallocz(sizeof(regex_t));
     1.7 -			if(regcomp(reg, rule[i].clpattern, 0))
     1.8 +			if(regcomp(reg, rule[i].clpattern, REG_EXTENDED))
     1.9  				free(reg);
    1.10  			else
    1.11  				rreg[i].clregex = reg;
    1.12  		}
    1.13  		if(rule[i].tpattern) {
    1.14  			reg = emallocz(sizeof(regex_t));
    1.15 -			if(regcomp(reg, rule[i].tpattern, 0))
    1.16 +			if(regcomp(reg, rule[i].tpattern, REG_EXTENDED))
    1.17  				free(reg);
    1.18  			else
    1.19  				rreg[i].tregex = reg;
    1.20 @@ -86,7 +86,7 @@
    1.21  		snprintf(prop, sizeof prop, "%s:%s:%s",
    1.22  				ch.res_class ? ch.res_class : "",
    1.23  				ch.res_name ? ch.res_name : "", c->name);
    1.24 -		for(i = 0; !matched && i < len; i++)
    1.25 +		for(i = 0; i < len; i++)
    1.26  			if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) {
    1.27  				c->isfloat = rule[i].isfloat;
    1.28  				for(j = 0; rreg[i].tregex && j < ntags; j++) {