]> diplodocus.org Git - nmh/blobdiff - uip/mhfixmsg.c
pop_retr(): Add a `void *closure' to be passed to action callback.
[nmh] / uip / mhfixmsg.c
index cef8593f717793ba8ccb83c6121b6acd2a124196..2737dac8ccc0e40dcfdfad52a8f221def7683e33 100644 (file)
@@ -11,7 +11,9 @@
 #include <h/mhparse.h>
 #include <h/utils.h>
 #include <h/signals.h>
+#include "../sbr/m_maildir.h"
 #include "../sbr/m_mktemp.h"
+#include "../sbr/mime_type.h"
 #include "mhfree.h"
 #include "mhoutsbr.h"
 #include "mhshowsbr.h"
@@ -816,7 +818,7 @@ replace_boundary (CT ct, char *file, char *boundary) {
     int compnum, state;
     char buf[NMH_BUFSIZ], name[NAMESZ];
     char *np, *vp;
-    m_getfld_state_t gstate = 0;
+    m_getfld_state_t gstate;
     int status = OK;
 
     if (ct->c_file == NULL) {
@@ -835,10 +837,11 @@ replace_boundary (CT ct, char *file, char *boundary) {
         return NOTOK;
     }
 
+    gstate = m_getfld_state_init(fpin);
     for (compnum = 1;;) {
         int bufsz = (int) sizeof buf;
 
-        switch (state = m_getfld (&gstate, name, buf, &bufsz, fpin)) {
+        switch (state = m_getfld2(&gstate, name, buf, &bufsz)) {
         case FLD:
         case FLDPLUS:
             compnum++;
@@ -850,7 +853,7 @@ replace_boundary (CT ct, char *file, char *boundary) {
             /* if necessary, get rest of field */
             while (state == FLDPLUS) {
                 bufsz = sizeof buf;
-                state = m_getfld (&gstate, name, buf, &bufsz, fpin);
+                state = m_getfld2(&gstate, name, buf, &bufsz);
                 vp = add (buf, vp);     /* add to previous value */
             }