From a8364b1c1c33a8b376e06812c9a54b0830f11d63 Mon Sep 17 00:00:00 2001 From: cherierm Date: Mon, 11 Aug 2008 12:03:43 +0000 Subject: [PATCH] If the length of the description is more than 76 characters replace it by the name of the Tesh file. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5889 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- tools/tesh2/src/unit.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/tesh2/src/unit.c b/tools/tesh2/src/unit.c index 43ba352e7b..afadd9b151 100644 --- a/tools/tesh2/src/unit.c +++ b/tools/tesh2/src/unit.c @@ -536,13 +536,23 @@ unit_summuarize(unit_t unit) return -1; } - if((unit->description) && strlen(unit->description) < 78) + if((unit->description) && strlen(unit->description) < 76) strcpy(title, unit->description); else sprintf(title, "file : %s",unit->fstream->name); if(unit->interrupted) - strcat(title, " (interrupted)"); + { + if(strlen(title) + strlen(" (interrupted)") < 76) + strcat(title, " (interrupted)"); + else + { + memset(title, 0, PATH_MAX + 1); + sprintf(title, "file : %s",unit->fstream->name); + strcat(title, " (interrupted)"); + + } + } print_title(title); -- 2.20.1