- if(matched) {
- for(i = 0; i < ntags; i++)
- c->tags[i] = trans->tags[i];
- }
- else {
- XGetClassHint(dpy, c->win, &ch);
- snprintf(prop, sizeof prop, "%s:%s:%s",
- ch.res_class ? ch.res_class : "",
- ch.res_name ? ch.res_name : "", c->name);
- for(i = 0; i < len; i++)
- if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) {
- c->isfloat = rule[i].isfloat;
- for(j = 0; rreg[i].tregex && j < ntags; j++) {
- if(!regexec(rreg[i].tregex, tags[j], 1, &tmp, 0)) {
- matched = True;
- c->tags[j] = True;
- }
- }
- }
- if(ch.res_class)
- XFree(ch.res_class);
- if(ch.res_name)
- XFree(ch.res_name);
- }
- if(!matched)
- for(i = 0; i < ntags; i++)
- c->tags[i] = seltag[i];