Mimeparser: skip all empty lines between mimeparts not just one.
[citadel.git] / 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;