{
TnyStream *mp_stream;
TnyStream *stream;
- TnyStream *input_stream;
+ TnyStream *input_stream = NULL;
GtkTextBuffer *buf;
GtkTextIter start, end;
gchar *text;
ModestFormatterPrivate *priv;
gint total, lines, total_lines, line_chars;
gboolean is_html, first_time;
+ gboolean forced_wrap;
buf = gtk_text_buffer_new (NULL);
stream = TNY_STREAM (tny_gtk_text_buffer_stream_new (buf));
line_chars = 0;
lines = 0;
+ forced_wrap = FALSE;
first_time = TRUE;
while (!tny_stream_is_eos (input_stream)) {
gchar buffer [128];
offset = buffer;
while (offset < buffer + n_read) {
- if (*offset == '\n') {
+ if (*offset == '\n' && !(forced_wrap && offset[1] == '\n')) {
total_lines ++;
line_chars = 0;
} else {
+ if (*offset == '\n') {
+ forced_wrap = FALSE;
+ }
line_chars ++;
if (line_chars >= LINE_WRAP) {
total_lines ++;
line_chars = 0;
+ forced_wrap = TRUE;
}
}
if (total_lines >= MAX_BODY_LINES)
from,
tny_header_get_date_sent (header),
filenames,
- 80);
+ 72);
g_free (from);
g_list_foreach (filenames, (GFunc) g_free, NULL);