>How does the attached patch look? It adds a new flag, for use by
>repl with Fcc. A test case confirms that it solves the problem.
Hm. I was actually thinking something more like the attached (note:
compiles, but I haven't actually tested it yet).
--Ken
diff --git a/uip/replsbr.c b/uip/replsbr.c
index 43948bf..fcdf546 100644
--- a/uip/replsbr.c
+++ b/uip/replsbr.c
@@ -115,17 +115,6 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen,
if (cptr)
cptr->c_name = mh_xstrdup("");
}
- /* set up the "fcc" pseudo-component */
- if (fcc) {
- cptr = fmt_findcomp ("fcc");
- if (cptr)
- cptr->c_text = mh_xstrdup(fcc);
- }
- if ((cp = getenv("USER"))) {
- cptr = fmt_findcomp ("user");
- if (cptr)
- cptr->c_text = mh_xstrdup(cp);
- }
if (!ccme)
ismymbox (NULL);
@@ -172,6 +161,23 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen,
adios (NULL, "m_getfld() returned %d", state);
}
}
+ /* set up the "fcc" pseudo-component */
+ cptr = fmt_findcomp ("fcc");
+ if (cptr) {
+ mh_xfree(cptr->c_text);
+ if (fcc)
+ cptr->c_text = mh_xstrdup(fcc);
+ else
+ cptr->c_text = NULL;
+ }
+ cptr = fmt_findcomp ("user");
+ if (cptr) {
+ mh_xfree(cptr->c_text);
+ if ((cp = getenv("USER")))
+ cptr->c_text = mh_xstrdup(cp);
+ else
+ cptr = NULL;
+ }
/*
* format and output the header lines.
_______________________________________________
Nmh-workers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/nmh-workers