aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-mime-parser.c')
-rw-r--r--camel/camel-mime-parser.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c
index ed4f50ca46..a51553d33a 100644
--- a/camel/camel-mime-parser.c
+++ b/camel/camel-mime-parser.c
@@ -1094,14 +1094,18 @@ folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save)
s->atleast = 1;
+ d(printf("skipping line\n"));
+
while ( (len = folder_read(s)) > 0 && len > s->atleast) { /* ensure we have at least enough room here */
inptr = s->inptr;
inend = s->inend-1;
c = -1;
while (inptr<inend
- && (c = *inptr++)!='\n')
+ && (c = *inptr++)!='\n') {
+ d(printf("(%2x,%c)", c, isprint(c)?c:'.'));
;
+ }
if (save)
g_byte_array_append(save, s->inptr, inptr-s->inptr);
@@ -1433,9 +1437,12 @@ folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, int
content:
/* treat eof as the last boundary in From mode */
- if (s->scan_from && s->eof)
+ if (s->scan_from && s->eof && s->atleast <= 1) {
onboundary = TRUE;
- part = s->parts;
+ part = NULL;
+ } else {
+ part = s->parts;
+ }
normal_exit:
s->atleast = atleast;
s->inptr = inptr;