>> Hm.  I was actually thinking something more like the attached (note:
>> compiles, but I haven't actually tested it yet).
>
>Let me save you the trouble :-/, it won't work.  The code that sucks
>the Fcc: header field value from the replied-to message is
>fmt_addcomptext(name, tmpbuf), after this:

D'oh!  My code didn't work, but only because I didn't move those calls
down far enough.  The attached patch DOES pass your test.

--Ken
diff --git a/uip/replsbr.c b/uip/replsbr.c
index 43948bf..15cab6c 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);
 
@@ -179,6 +168,24 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen,
 finished:
     m_getfld_state_destroy (&gstate);
 
+    /* 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;
+    }
+
     /*
      * if there's a "Subject" component, strip any "Re:"s off it
      */
_______________________________________________
Nmh-workers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/nmh-workers

Reply via email to