From b2d0b01b94c0e03b41422ef5df5ae0512f1060f5 Mon Sep 17 00:00:00 2001 From: Daniel Carbonell Fraj Date: Tue, 25 Mar 2003 13:24:10 +0000 Subject: [PATCH] fix for a partyline text_entry bug --- ChangeLog | 6 ++++++ src/partyline.c | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d370c6..97337ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-03-25 Dani Carbonell + + * src/partyline.c (entrykey): fixed a bug when hitting the up or + down arrow key when writing in the partyline textentry, after inserting + a unicode control character. + 2003-03-18 Jordi Mallach * configure.in (ALL_LINGUAS): Added "ja" (Japanese). diff --git a/src/partyline.c b/src/partyline.c index 62b67de..b5fa633 100644 --- a/src/partyline.c +++ b/src/partyline.c @@ -351,13 +351,16 @@ void textentry (GtkWidget *widget) static gint entrykey (GtkWidget *widget, GdkEventKey *key) { int keyval = key->keyval; - gchar *text; + gchar *text = NULL; if (keyval == GDK_Up || keyval == GDK_Down) { if (plh_cur == plh_end) { text = g_locale_from_utf8 (gtk_entry_get_text (GTK_ENTRY(widget)), -1, NULL, NULL, NULL); - GTET_O_STRCPY (plhistory[plh_end], text); - g_free (text); + if (text != NULL) + { + GTET_O_STRCPY (plhistory[plh_end], text); + g_free (text); + } } switch (keyval) { case GDK_Up: -- 2.50.1