- if ((cptr = wantcomp[CHASH (name)]))
- do {
- if (!strcasecmp (name, cptr->c_name)) {
- char_read += msg_count;
- if (!cptr->c_text) {
- cptr->c_text = tmpbuf;
- *--savecomp = cptr;
- tmpbuf = *nxtbuf++;
- }
- else {
- i = strlen (cp = cptr->c_text) - 1;
- if (cp[i] == '\n') {
- if (cptr->c_type & CT_ADDR) {
- cp[i] = 0;
- cp = add (",\n\t", cp);
- }
- else
- cp = add ("\t", cp);
- }
- cptr->c_text = add (tmpbuf, cp);
- }
- while (state == FLDPLUS) {
- state = m_getfld (state, name, tmpbuf,
- SBUFSIZ, inb);
- cptr->c_text = add (tmpbuf, cptr->c_text);
- char_read += msg_count;
- }
- break;
- }
- } while ((cptr = cptr->c_next));
+ i = fmt_addcomptext(name, tmpbuf);
+ if (i != -1) {
+ char_read += msg_count;
+ while (state == FLDPLUS) {
+ state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb);
+ fmt_appendcomp(i, name, tmpbuf);
+ char_read += msg_count;
+ }
+ }