--- src/labels.c 2004-04-13 17:24:24.776604127 +0200 +++ src/labels.c.new 2004-04-13 17:36:08.597643469 +0200 @@ -35,10 +35,12 @@ if (i == j) return s; i = (gchar *) strchr(i + 1, DIR_SEPARATOR_C); // second slash - *i = '\0'; - strcat(s, DIR_SEPARATOR_S); - strcat(s, "..."); - strcat(s, buf); + if((i-s+1)+5+strlen(buf) <= strlen(s)) { // only modify if new version is shorter + *i = '\0'; + strcat(s, DIR_SEPARATOR_S); + strcat(s, "..."); + strcat(s, buf); + } return s; }