sync with sylpheed 0.6.5cvs18
[claws.git] / src / textview.c
index c9ab5c9c2f1ed7a4bc8a4275982c9582e393f0f8..0dff13fceaae574c65aecb720b9a9a26a57e527b 100644 (file)
@@ -299,8 +299,13 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
                        glong fpos;
                        MimeInfo *parent = mimeinfo->parent;
 
-                       while (parent->parent)
+                       while (parent->parent) {
+                               if (parent->main &&
+                                   parent->main->mime_type ==
+                                       MIME_MESSAGE_RFC822)
+                                       break;
                                parent = parent->parent;
+                       }
 
                        if ((fpos = ftell(fp)) < 0)
                                perror("ftell");
@@ -312,6 +317,7 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
                                        perror("fseek");
                        }
                }
+               /* skip MIME part headers */
                while (fgets(buf, sizeof(buf), fp) != NULL)
                        if (buf[0] == '\r' || buf[0] == '\n') break;
        }