projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added a note about formataddr(), because this had confused me.
[mmh]
/
uip
/
replsbr.c
diff --git
a/uip/replsbr.c
b/uip/replsbr.c
index
b63d013
..
624ffd6
100644
(file)
--- a/
uip/replsbr.c
+++ b/
uip/replsbr.c
@@
-66,8
+66,8
@@
static void replfilter(FILE *, FILE *, char *);
void
void
-replout(FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen,
- int mime, char *form, char *filter, char *fcc)
+replout(FILE *inb, char *msg, char *drft, struct msgs *mp,
+ int mime, char *form, char *filter)
{
register int state, i;
register struct comp *cptr;
{
register int state, i;
register struct comp *cptr;
@@
-127,12
+127,6
@@
replout(FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen,
if (cptr)
cptr->c_name = "";
}
if (cptr)
cptr->c_name = "";
}
- /* set up the "fcc" pseudo-component */
- if (fcc) {
- FINDCOMP(cptr, "fcc");
- if (cptr)
- cptr->c_text = getcpy(fcc);
- }
if ((cp = getenv("USER"))) {
FINDCOMP(cptr, "user");
if (cptr)
if ((cp = getenv("USER"))) {
FINDCOMP(cptr, "user");
if (cptr)
@@
-236,7
+230,7
@@
finished:
dat[0] = 0;
dat[1] = 0;
dat[2] = 0;
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);
dat[4] = 0;
fmt_scan(fmt, scanl, i, dat);
fputs(scanl, out);
@@
-245,19
+239,13
@@
finished:
fputs( badaddrs, out);
}
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);
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);
}
fflush(out);
@@
-265,6
+253,15
@@
finished:
adios(drft, "error writing");
fclose(out);
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, 0, -2, 1);
+ }
+
/* return dynamically allocated buffers */
free(scanl);
for (nxtbuf = compbuffers, i = ncomps; (cptr = *savecomp++);
/* return dynamically allocated buffers */
free(scanl);
for (nxtbuf = compbuffers, i = ncomps; (cptr = *savecomp++);
@@
-311,6
+308,9
@@
static unsigned int bufsiz=0; /* current size of buf */
** We try to not do a lot of malloc/copy/free's (which is why we
** don't call "getcpy") but still place no upper limit on the
** length of the result string.
** We try to not do a lot of malloc/copy/free's (which is why we
** don't call "getcpy") but still place no upper limit on the
** length of the result string.
+**
+** This routine is an override for the equally named one in sbr/fmt_addr.c.
+** Don't delete it!
*/
char *
formataddr(char *orig, char *str)
*/
char *
formataddr(char *orig, char *str)
@@
-441,7
+441,7
@@
replfilter(FILE *in, FILE *out, char *filter)
rewind(in);
lseek(fileno(in), (off_t) 0, SEEK_SET);
rewind(in);
lseek(fileno(in), (off_t) 0, SEEK_SET);
- switch (pid = vfork()) {
+ switch (pid = fork()) {
case NOTOK:
adios("fork", "unable to");
case NOTOK:
adios("fork", "unable to");