aboutsummaryrefslogtreecommitdiff
path: root/mail/emil/files/patch-mimeparse.c
blob: b3eab04c834ee3ef65619bad6dfbc9e6af5d5c78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- mimeparse.c.orig	1996-06-04 13:36:59 UTC
+++ mimeparse.c
@@ -219,9 +219,40 @@ parse_mime_siblings(struct message *m)
 	    inbuf->bodystart,
 	    inbuf->bodyend);
 #endif
+  /* FIX */
+  if (m->sd->encoding == EMULTI && m->sd->endbound != NULL)
+    {
+      int tttt;
+      move_past_boundary(m, m->sd->endbound);
+      for (;;)
+      {
+        tttt = get_line(m->sd);
+#ifdef DEBUG
+          if (edebug)
+            fprintf(stderr," get_line = %d\n", tttt);
+#endif
+        if (tttt == 1)
+          {
+            inbuf->offset += tttt;
+            inbuf->loffset += 1;
+            continue;
+          }
+        if (tttt == 2 && *(m->sd->contents + m->sd->offset) == '\r')
+          {
+            inbuf->offset += tttt;
+            inbuf->loffset += 1;
+            continue;
+          }
+        break;
+      }
 
-  m->sd->offset = m->sd->bodyend;
-  if (getline(m->sd) == 0)
+    }
+  else
+  /* END_FIX */
+    m->sd->offset = m->sd->bodyend;
+
+
+  if (get_line(m->sd) == 0)
     return(OK);
   if (m->sd->offset < m->sd->end)
     {