X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Freplsbr.c;h=b63d0134d8dcb71fcac55b91ee999434e6618cc3;hp=1bdab9e92be631660525f0b52a9f922a14872a37;hb=5b792c4424571f05bc2008e3109797d18d7d00d1;hpb=8e5be81f784682822f5e868c1bf3c8624682bd23 diff --git a/uip/replsbr.c b/uip/replsbr.c index 1bdab9e..b63d013 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -147,60 +147,60 @@ replout(FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, for (state = FLD;;) { state = m_getfld(state, name, tmpbuf, SBUFSIZ, inb); switch (state) { - case FLD: - case FLDPLUS: - /* - ** if we're interested in this component, - ** save a pointer to the component text, - ** then start using our next free buffer - ** as the component temp buffer (buffer - ** switching saves an extra copy of the - ** component text). - */ - if ((cptr = wantcomp[CHASH(name)])) - do { - if (!mh_strcasecmp(name, cptr->c_name)) { - char_read += msg_count; - if (! cptr->c_text) { - i = strlen(cptr->c_text = tmpbuf) - 1; - if (tmpbuf[i] == '\n') - tmpbuf[i] = '\0'; - *--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); - } + case FLD: + case FLDPLUS: + /* + ** if we're interested in this component, save + ** a pointer to the component text, then start + ** using our next free buffer as the component + ** temp buffer (buffer switching saves an extra + ** copy of the component text). + */ + if ((cptr = wantcomp[CHASH(name)])) + do { + if (!mh_strcasecmp(name, cptr->c_name)) { + char_read += msg_count; + if (! cptr->c_text) { + i = strlen(cptr->c_text = tmpbuf) - 1; + if (tmpbuf[i] == '\n') + tmpbuf[i] = '\0'; + *--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; + cptr->c_text = add(tmpbuf, cp); } - } while ((cptr = cptr->c_next)); + 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)); - while (state == FLDPLUS) - state = m_getfld(state, name, tmpbuf, SBUFSIZ, inb); - break; + while (state == FLDPLUS) + state = m_getfld(state, name, tmpbuf, + SBUFSIZ, inb); + break; - case LENERR: - case FMTERR: - case BODY: - case FILEEOF: - goto finished; + case LENERR: + case FMTERR: + case BODY: + case FILEEOF: + goto finished; - default: - adios(NULL, "m_getfld() returned %d", state); + default: + adios(NULL, "m_getfld() returned %d", state); } } @@ -442,28 +442,27 @@ replfilter(FILE *in, FILE *out, char *filter) lseek(fileno(in), (off_t) 0, SEEK_SET); switch (pid = vfork()) { - case NOTOK: - adios("fork", "unable to"); - - case OK: - dup2(fileno(in), fileno(stdin)); - dup2(fileno(out), fileno(stdout)); - closefds(3); - - execlp(mhlproc, mhl, "-form", filter, "-noclear", - NULL); - errstr = strerror(errno); - write(2, "unable to exec ", 15); - write(2, mhlproc, strlen(mhlproc)); - write(2, ": ", 2); - write(2, errstr, strlen(errstr)); - write(2, "\n", 1); - _exit(-1); - - default: - if (pidXwait(pid, mhl)) - done(1); - fseek(out, 0L, SEEK_END); - break; + case NOTOK: + adios("fork", "unable to"); + + case OK: + dup2(fileno(in), fileno(stdin)); + dup2(fileno(out), fileno(stdout)); + closefds(3); + + execlp(mhlproc, mhl, "-form", filter, "-noclear", NULL); + errstr = strerror(errno); + write(2, "unable to exec ", 15); + write(2, mhlproc, strlen(mhlproc)); + write(2, ": ", 2); + write(2, errstr, strlen(errstr)); + write(2, "\n", 1); + _exit(-1); + + default: + if (pidXwait(pid, mhl)) + done(1); + fseek(out, 0L, SEEK_END); + break; } }