projects
/
modest
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Increase the char limit for considering a header as "secure"
[modest]
/
src
/
modest-formatter.c
diff --git
a/src/modest-formatter.c
b/src/modest-formatter.c
index
c496ea9
..
90f45cf
100644
(file)
--- a/
src/modest-formatter.c
+++ b/
src/modest-formatter.c
@@
-95,7
+95,7
@@
extract_text (ModestFormatter *self, TnyMimePart *body)
gchar *text;
ModestFormatterPrivate *priv;
gint total, lines, total_lines, line_chars;
gchar *text;
ModestFormatterPrivate *priv;
gint total, lines, total_lines, line_chars;
- gboolean is_html;
+ gboolean is_html, first_time;
buf = gtk_text_buffer_new (NULL);
stream = TNY_STREAM (tny_gtk_text_buffer_stream_new (buf));
buf = gtk_text_buffer_new (NULL);
stream = TNY_STREAM (tny_gtk_text_buffer_stream_new (buf));
@@
-190,6
+190,7
@@
extract_text (ModestFormatter *self, TnyMimePart *body)
g_object_unref (is);
}
g_object_unref (is);
}
+ first_time = TRUE;
while (!tny_stream_is_eos (input_stream)) {
gchar buffer [128];
gchar *offset;
while (!tny_stream_is_eos (input_stream)) {
gchar buffer [128];
gchar *offset;
@@
-227,14
+228,16
@@
extract_text (ModestFormatter *self, TnyMimePart *body)
gchar *buffer_ptr;
/* Discard lines artificially inserted by
gchar *buffer_ptr;
/* Discard lines artificially inserted by
- Camel when translating from HTML to text */
+ Camel when translating from HTML to
+ text. Do it only for the first read */
buffer_ptr = buffer;
buffer_ptr = buffer;
- if (lines) {
+ if (G_UNLIKELY (first_time) && lines) {
int i;
for (i=0; i < lines; i++) {
buffer_ptr = strchr (buffer_ptr, '\n');
buffer_ptr++;
}
int i;
for (i=0; i < lines; i++) {
buffer_ptr = strchr (buffer_ptr, '\n');
buffer_ptr++;
}
+ first_time = FALSE;
}
to_write = offset - buffer_ptr;
n_write = tny_stream_write (stream, buffer_ptr, to_write);
}
to_write = offset - buffer_ptr;
n_write = tny_stream_write (stream, buffer_ptr, to_write);