From 00e4e9975e078ed2be27c5a6c3676dee4d11fd24 Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Tue, 6 Jul 2010 23:03:40 +0200 Subject: [PATCH] Fix a bug that printed the tag previous count instead of the new one when using the tag_add with the name_count = true --- src/tag.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/tag.c b/src/tag.c index 160a44c..2188efd 100644 --- a/src/tag.c +++ b/src/tag.c @@ -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);