commit a8e7215e124fe8ef32a3221fbd4a469ea796c651
parent 41f268a1fefc8702780d8415f18bce321f7be03a
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Wed, 15 Mar 2006 10:44:54 +0100
fixed rule matching
Diffstat:
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/cmd/wm/client.c b/cmd/wm/client.c
@@ -335,11 +335,21 @@ manage_client(Client *c)
t = ntag ? tag[sel] : alloc_tag(def.tag);
if(!c->ntag) {
- c->ntag++;
cext_strlcpy(c->tag[0], t->name, sizeof(c->tag[0]));
+ c->ntag++;
+ }
+ {
+ unsigned int i;
+ for(i = 0; i < c->ntag; i++)
+ fprintf(stderr, "(a) c->tag[%d] -> %s\n", i, c->tag[i]);
}
update_tags();
+ {
+ unsigned int i;
+ for(i = 0; i < c->ntag; i++)
+ fprintf(stderr, "(b) c->tag[%d] -> %s\n", i, c->tag[i]);
+ }
}
static int
diff --git a/cmd/wm/rule.c b/cmd/wm/rule.c
@@ -36,7 +36,7 @@ parse(char *data, unsigned int *n)
static unsigned int rulesz = 0;
unsigned int i;
int mode = IGNORE;
- char *p, *r, *t, regex[256], tags[MAX_TAGLEN];
+ char *p, *r, *t, regex[256], tags[256];
if(!data || !strlen(data))
return nil;
@@ -85,12 +85,9 @@ parse(char *data, unsigned int *n)
i++;
}
else {
- if(*p == ' ' || *p == '\t') {
- if(tags[0] == 0)
- continue; /* skip prefixed whitespaces */
- }
- else
- *t = *p;
+ if((*p == ' ' || *p == '\t') && (tags[0] == 0))
+ continue; /* skip prefixed whitespaces */
+ *t = *p;
t++;
}
break;