]> code.citadel.org Git - citadel.git/blobdiff - citadel/mime_parser.c
* Changed the comments at the beginning of each file to a consistent format
[citadel.git] / citadel / mime_parser.c
index 4dfe32a70c5b7799e5c768af44d56c9ff3d49a52..34decdd0211b798209210f1d6f292fe0e560108a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * mime_parser.c
+ * $Id$
  *
  * This is a really bad attempt at writing a parser to handle MIME-encoded
  * messages.
@@ -7,8 +7,6 @@
  * Copyright (c) 1998-1999 by Art Cancro
  * This code is distributed under the terms of the GNU General Public License.
  *
- * $Id$
- *
  */
 
 #include "sysdep.h"
@@ -21,9 +19,6 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <errno.h>
-#ifdef HAVE_PTHREAD_H
-#include <pthread.h>
-#endif
 #include "citadel.h"
 #include "mime_parser.h"
 #include "sysdep_decls.h"
@@ -251,6 +246,7 @@ void the_mime_parser(char *partnum,
        memset(encoding, 0, sizeof encoding);
        memset(name, 0, sizeof name);
        memset(filename, 0, sizeof filename);
+       memset(disposition, 0, sizeof disposition);
 
        /* Learn interesting things from the headers */
        strcpy(header, "");
@@ -305,6 +301,11 @@ void the_mime_parser(char *partnum,
        /* If this is a multipart message, then recursively process it */
        part_start = NULL;
        if (is_multipart) {
+
+               /* Tell the client about this message's multipartedness */
+               CallBack("", "", partnum, "", NULL, content_type, 0);
+
+               /* Figure out where the boundaries are */
                sprintf(startary, "--%s", boundary);
                sprintf(endary, "--%s--", boundary);
                do {
@@ -344,10 +345,6 @@ void the_mime_parser(char *partnum,
                            name, filename, CallBack);
        }
 
-       /* Otherwise, merely tell the client about our multipartedness */
-       else {
-               CallBack("", "", partnum, "", NULL, content_type, 0);
-       }
 
 }