Mercurial > pidgin
changeset 15764:f1e4121dcb1e
Fix a crash when selecting text in an empty TV.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 05 Mar 2007 01:26:31 +0000 |
parents | d318c6672011 |
children | 52ee22ba2cd2 |
files | console/libgnt/gnttextview.c console/libgnt/test/tv.c console/libgnt/wms/s.c |
diffstat | 3 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/console/libgnt/gnttextview.c Sat Mar 03 04:06:19 2007 +0000 +++ b/console/libgnt/gnttextview.c Mon Mar 05 01:26:31 2007 +0000 @@ -204,9 +204,9 @@ do { line = lines->data; lines = lines->next; - } while (line && !line->segments); + } while (line && !line->segments && lines); - if (!line) /* no valid line */ + if (!line || !line->segments) /* no valid line */ return NULL; segs = line->segments; seg = (GntTextSegment *)segs->data;
--- a/console/libgnt/test/tv.c Sat Mar 03 04:06:19 2007 +0000 +++ b/console/libgnt/test/tv.c Mon Mar 05 01:26:31 2007 +0000 @@ -83,6 +83,7 @@ gnt_entry_set_history_length(GNT_ENTRY(entry), -1); g_signal_connect_after(G_OBJECT(entry), "key_pressed", G_CALLBACK(key_pressed), view); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "\n", GNT_TEXT_FLAG_NORMAL); gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "plugins: ", GNT_TEXT_FLAG_BOLD); gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "this is the 1st line\n", GNT_TEXT_FLAG_NORMAL);
--- a/console/libgnt/wms/s.c Sat Mar 03 04:06:19 2007 +0000 +++ b/console/libgnt/wms/s.c Mon Mar 05 01:26:31 2007 +0000 @@ -182,7 +182,7 @@ text = gnt_get_clipboard_string(); clip = gnt_hwindow_new(FALSE); GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_TRANSIENT); - GNT_WIDGET_UNSET_FLAGS(clip, GNT_WIDGET_NO_BORDER); + GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_NO_BORDER); gnt_box_set_pad(GNT_BOX(clip), 0); gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" ")); gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(text));