Mimeparser: skip all empty lines between mimeparts not just one.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 6 Nov 2011 19:46:42 +0000 (20:46 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 6 Nov 2011 20:08:01 +0000 (21:08 +0100)
  - this makes us more robust.

libcitadel/lib/mime_parser.c

index 986c305442c07554a3a3fcab9a653637fc5cf106..11f2a27cfb9b3a1938ea7dd87a8742e5ef4fc99a 100644 (file)
@@ -626,16 +626,14 @@ static void recurseable_mime_parser(char *partnum,
                /* Figure out where the boundaries are */
                m->b[startary].len = snprintf(m->b[startary].Key, SIZ, "--%s", m->b[boundary].Key);
                SubMimeHeaders = InitInterestingMimes ();
-               if (*ptr == '\r')
-                       ptr ++;
-               if (*ptr == '\n')
-                       ptr ++;
+
+               while ((*ptr == '\r') || (*ptr == '\n')) ptr ++;
+
                if (strncmp(ptr, m->b[startary].Key, m->b[startary].len) == 0)
                        ptr += m->b[startary].len;
-               if (*ptr == '\r')
-                       ptr ++;
-               if (*ptr == '\n')
-                       ptr ++;
+
+               while ((*ptr == '\r') || (*ptr == '\n')) ptr ++;
+
                part_start = NULL;
                do {
                        char *optr;