Selbar: Put ... only when sel->title lenght > max_lenght

This commit is contained in:
Martin Duquesnoy 2010-04-16 19:41:02 +02:00
parent 49b9a08fab
commit 5875af2949

View File

@ -188,7 +188,9 @@ infobar_draw_selbar(int sc)
{
str = emalloc(conf.selbar.maxlenght + 4, sizeof(char));
strncpy(str, sel->title, conf.selbar.maxlenght);
strcat(str, "...");
if(strlen(sel->title) > conf.selbar.maxlenght)
strcat(str, "...");
}
barwin_resize(infobar[sc].selbar, textw(str ? str : sel->title) + PAD, infobar[sc].geo.height - 2);