X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Freplsbr.c;h=907465ef2590148a02daa455aee6adb0c0391a3b;hb=e31729d51e468c4cd56fa049850619a94e53840a;hp=b63d0134d8dcb71fcac55b91ee999434e6618cc3;hpb=5b792c4424571f05bc2008e3109797d18d7d00d1;p=mmh diff --git a/uip/replsbr.c b/uip/replsbr.c index b63d013..907465e 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -66,7 +66,7 @@ static void replfilter(FILE *, FILE *, char *); void -replout(FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, +replout(FILE *inb, char *msg, char *drft, struct msgs *mp, int mime, char *form, char *filter, char *fcc) { register int state, i; @@ -236,7 +236,7 @@ finished: dat[0] = 0; dat[1] = 0; dat[2] = 0; - dat[3] = outputlinelen; + dat[3] = OUTPUTLINELEN; dat[4] = 0; fmt_scan(fmt, scanl, i, dat); fputs(scanl, out); @@ -245,19 +245,13 @@ finished: fputs( badaddrs, out); } - /* - ** Check if we should filter the message - ** or add mhbuild directives - */ + /* Check if we should filter the message */ if (filter) { fflush(out); if (ferror(out)) adios(drft, "error writing"); replfilter(inb, out, filter); - } else if (mime && mp) { - fprintf(out, "#forw [original message] +%s %s\n", - mp->foldpath, m_name(mp->lowsel)); } fflush(out); @@ -265,6 +259,15 @@ finished: adios(drft, "error writing"); fclose(out); + /* if we want mime, then add an attachment header */ + if (!filter && mime && mp) { + char buffer[BUFSIZ]; + + snprintf(buffer, sizeof buffer, "+%s %s", + mp->foldpath, m_name(mp->lowsel)); + annotate(drft, attach_hdr, buffer, 1, 0, -2, 1); + } + /* return dynamically allocated buffers */ free(scanl); for (nxtbuf = compbuffers, i = ncomps; (cptr = *savecomp++); @@ -441,7 +444,7 @@ replfilter(FILE *in, FILE *out, char *filter) rewind(in); lseek(fileno(in), (off_t) 0, SEEK_SET); - switch (pid = vfork()) { + switch (pid = fork()) { case NOTOK: adios("fork", "unable to");