2005-07-08 [colin] 1.9.12cvs30

* src/textview.c
	* src/unmime.c
		Fix again problems decoding broken headers
	* src/gtk/inputdialog.c
		Fix local variable shadowing a global one
This commit is contained in:
Colin Leroy 2005-07-08 16:38:51 +00:00
parent 5045549728
commit b19f2a3311
6 changed files with 24 additions and 8 deletions

View file

@ -1,3 +1,11 @@
2005-07-08 [colin] 1.9.12cvs30
* src/textview.c
* src/unmime.c
Fix again problems decoding broken headers
* src/gtk/inputdialog.c
Fix local variable shadowing a global one
2005-07-08 [colin] 1.9.12cvs29
* src/msgcache.c

View file

@ -624,3 +624,4 @@
( cvs diff -u -r 1.1.2.23 -r 1.1.2.24 commitHelper; cvs diff -u -r 1.2.4.10 -r 1.2.4.11 src/common/template.c; ) > 1.9.12cvs27.patchset
( cvs diff -u -r 1.179.2.50 -r 1.179.2.51 src/imap.c; ) > 1.9.12cvs28.patchset
( cvs diff -u -r 1.16.2.21 -r 1.16.2.22 src/msgcache.c; ) > 1.9.12cvs29.patchset
( cvs diff -u -r 1.96.2.60 -r 1.96.2.61 src/textview.c; cvs diff -u -r 1.8.2.5 -r 1.8.2.6 src/unmime.c; cvs diff -u -r 1.2.2.9 -r 1.2.2.10 src/gtk/inputdialog.c; ) > 1.9.12cvs30.patchset

View file

@ -11,7 +11,7 @@ MINOR_VERSION=9
MICRO_VERSION=12
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=29
EXTRA_VERSION=30
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -166,7 +166,6 @@ static void input_dialog_create(void)
GtkWidget *w_hbox;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkWidget *confirm_area;
GtkWidget *icon;

View file

@ -1158,6 +1158,12 @@ static void textview_make_clickable_parts(TextView *textview,
GtkTextView *text = GTK_TEXT_VIEW(textview->text);
GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
GtkTextIter iter;
gchar *mybuf = g_strdup(linebuf);
if (!g_utf8_validate(linebuf, -1, NULL)) {
mybuf = g_malloc(strlen(linebuf)*2 +1);
conv_localetodisp(mybuf, strlen(linebuf)*2 +1, linebuf);
}
/* parse table - in order of priority */
struct table {
@ -1198,7 +1204,7 @@ static void textview_make_clickable_parts(TextView *textview,
gtk_text_buffer_get_end_iter(buffer, &iter);
/* parse for clickable parts, and build a list of begin and end positions */
for (walk = linebuf, n = 0;;) {
for (walk = mybuf, n = 0;;) {
gint last_index = PARSE_ELEMS;
gchar *scanpos = NULL;
@ -1230,7 +1236,7 @@ static void textview_make_clickable_parts(TextView *textview,
/* colorize this line */
if (head.next) {
const gchar *normal_text = linebuf;
const gchar *normal_text = mybuf;
/* insert URIs */
for (last = head.next; last != NULL;
@ -1260,8 +1266,9 @@ static void textview_make_clickable_parts(TextView *textview,
(buffer, &iter, normal_text, -1, fg_tag, NULL);
} else {
gtk_text_buffer_insert_with_tags_by_name
(buffer, &iter, linebuf, -1, fg_tag, NULL);
(buffer, &iter, mybuf, -1, fg_tag, NULL);
}
g_free(mybuf);
}
#undef ADD_TXT_POS
@ -1284,8 +1291,8 @@ static void textview_write_line(TextView *textview, const gchar *str,
if (!conv)
strncpy2(buf, str, sizeof(buf));
else if (conv_convert(conv, buf, sizeof(buf), str) < 0)
conv_utf8todisp(buf, sizeof(buf), str);
conv_localetodisp(buf, sizeof(buf), str);
strcrchomp(buf);
//if (prefs_common.conv_mb_alnum) conv_mb_alnum(buf);
fg_color = NULL;

View file

@ -116,7 +116,8 @@ gchar *unmime_header(const gchar *encoded_str)
/* convert to UTF-8 */
conv_str = conv_codeset_strdup(decoded_text, charset, NULL);
if (!conv_str) {
if (!conv_str || !g_utf8_validate(conv_str, -1, NULL)) {
g_free(conv_str);
conv_str = g_malloc(len + 1);
conv_utf8todisp(conv_str, len + 1, decoded_text);
}