]> code.citadel.org Git - citadel.git/commitdiff
* mime_parser.c: more robust parsing of Content-Type header
authorMichael Hampton <io_error@uncensored.citadel.org>
Sun, 17 Mar 2002 00:08:02 +0000 (00:08 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Sun, 17 Mar 2002 00:08:02 +0000 (00:08 +0000)
citadel/ChangeLog
citadel/mime_parser.c

index 9e80bfd7107851993f89807a5820de4fc09eeaf7..cbb90c38cb1e082856c4c444eb7e37b5fa5409b2 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 590.156  2002/03/17 00:08:02  error
+ * mime_parser.c: more robust parsing of Content-Type header
+
  Revision 590.155  2002/03/16 05:22:59  ajc
  * Post an error message to Aide> when unlink() is unable to delete old
    database log files.
@@ -3513,3 +3516,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index 8203c86f89d957963e58a1949ec10ac9ae372758..f64005c170005cb807ed08b9cba8eefa1741877a 100644 (file)
@@ -345,6 +345,11 @@ void the_mime_parser(char *partnum,
                        if (!strncasecmp(header, "Content-type: ", 14)) {
                                strcpy(content_type, &header[14]);
                                extract_key(name, content_type, "name");
+                               /* Deal with weird headers */
+                               if (strchr(content_type, ' '))
+                                       *(strchr(content_type, ' ')) = '\0';
+                               if (strchr(content_type, ';'))
+                                       *(strchr(content_type, ';')) = '\0';
                                lprintf(9, "Extracted content-type <%s>\n",
                                        content_type);
                        }