Index: handler.c =================================================================== RCS file: /home/roessler/cvsroot/mutt/handler.c,v retrieving revision 2.14 diff -u -u -r2.14 handler.c --- handler.c 1999/07/26 17:31:24 2.14 +++ handler.c 1999/09/23 20:32:00 @@ -388,6 +388,7 @@ size_t indent_len; size_t word_len; size_t buff_used; + size_t param_used; size_t param_len; int tag_level[RICH_LAST_TAG]; int WrapMargin; @@ -536,7 +537,10 @@ { if (stte->tag_level[RICH_COLOR]) { - stte->param[stte->param_len++] = c; + if (stte->param_used + 1 >= stte->param_len) + safe_realloc ((void **) &stte->param, (stte->param_len += STRING)); + + stte->param[stte->param_used++] = c; } return; /* nothing to do */ } @@ -637,7 +641,7 @@ stte->tag_level[j]--; if ((stte->s->flags & M_DISPLAY) && j == RICH_PARAM && stte->tag_level[RICH_COLOR]) { - stte->param[stte->param_len] = '\0'; + stte->param[stte->param_used] = '\0'; if (!mutt_strcasecmp(stte->param, "black")) { enriched_puts("\033[30m", stte); @@ -670,13 +674,18 @@ { enriched_puts("\033[37m", stte); } - stte->param_len = 0; - stte->param[0] = '\0'; } if ((stte->s->flags & M_DISPLAY) && j == RICH_COLOR) { enriched_puts("\033[0m", stte); } + + /* flush parameter buffer when closing the tag */ + if (j == RICH_PARAM) + { + stte->param_used = 0; + stte->param[0] = '\0'; + } } else stte->tag_level[j]++; @@ -704,6 +713,9 @@ stte.line_max = stte.WrapMargin * 4; stte.line = (char *) safe_calloc (1, stte.line_max + 1); stte.param = (char *) safe_calloc (1, STRING); + + stte.param_len = STRING; + stte.param_used = 0; if (s->prefix) {