dwm-meillo

diff tag.c @ 413:761d0cd6e504

fixing c->weight handling
author Anselm R. Garbe <arg@10kloc.org>
date Tue, 05 Sep 2006 08:24:00 +0200
parents 6786cd59468f
children e689e540607a
line diff
     1.1 --- a/tag.c	Mon Sep 04 19:19:37 2006 +0200
     1.2 +++ b/tag.c	Tue Sep 05 08:24:00 2006 +0200
     1.3 @@ -106,8 +106,7 @@
     1.4  	if(!matched)
     1.5  		for(i = 0; i < ntags; i++)
     1.6  			c->tags[i] = seltag[i];
     1.7 -	for(i = 0; i < ntags && !c->tags[i]; i++);
     1.8 -	c->weight = i;
     1.9 +	for(c->weight = 0; c->weight < ntags && !c->tags[c->weight]; c->weight++);
    1.10  }
    1.11  
    1.12  void
    1.13 @@ -121,6 +120,7 @@
    1.14  	for(i = 0; i < ntags; i++)
    1.15  		sel->tags[i] = False;
    1.16  	sel->tags[arg->i] = True;
    1.17 +	sel->weight = arg->i;
    1.18  	arrange(NULL);
    1.19  }
    1.20  
    1.21 @@ -136,5 +136,6 @@
    1.22  	for(i = 0; i < ntags && !sel->tags[i]; i++);
    1.23  	if(i == ntags)
    1.24  		sel->tags[arg->i] = True;
    1.25 +	for(sel->weight = 0; sel->weight < ntags && !sel->tags[sel->weight]; sel->weight++);
    1.26  	arrange(NULL);
    1.27  }