From 5875af29492bd5b0c335348bca1fc980d8612b07 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Fri, 16 Apr 2010 19:41:02 +0200 Subject: [PATCH] Selbar: Put ... only when sel->title lenght > max_lenght --- src/infobar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/infobar.c b/src/infobar.c index 6f5d0de..ba33c2b 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -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);