Fix a bug that printed the tag previous count instead of the new one when using the tag_add with the name_count = true

This commit is contained in:
Raphael Khaiat 2010-07-06 23:03:40 +02:00
parent aa04eab011
commit 00e4e9975e

View File

@ -479,7 +479,16 @@ tag_new(int s, char *name)
{
char * displayedName;
if((!name || strlen(name) == 0))
if(conf.ntag[s] + 1 > MAXTAG)
{
warnx("Too many tag: Can't create new tag");
return;
}
++conf.ntag[s];
if(!name || strlen(name) == 0)
{
if(conf.tagnamecount)
{
@ -498,17 +507,8 @@ tag_new(int s, char *name)
conf.default_tag.barpos, conf.default_tag.layout,
0, NULL, 0 };
if(conf.ntag[s] + 1 > MAXTAG)
{
warnx("Too many tag: Can't create new tag");
return;
}
++conf.ntag[s];
tags[s][conf.ntag[s]] = t;
/* tags[s][conf.ntag[s]].name = _strdup(displayedName);*/
infobar_update_taglist(s);
infobar_draw(s);