[evolution] Strip whitespace off email addresses in contact editor.



commit 7ff2c1327e2bba4b88e8d37107a06cc5da7fd78b
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Mar 10 15:22:08 2010 -0500

    Strip whitespace off email addresses in contact editor.

 addressbook/gui/contact-editor/e-contact-editor.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index f7c3080..2807b9e 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -775,7 +775,8 @@ extract_email_record (EContactEditor *editor, gint record, gchar **address, gint
 {
 	GtkWidget *location_combo_box;
 	GtkWidget *email_entry;
-	gchar     *widget_name;
+	gchar *widget_name;
+	const gchar *text;
 
 	widget_name = g_strdup_printf ("combobox-email-%d", record);
 	location_combo_box = e_builder_get_widget (editor->builder, widget_name);
@@ -785,7 +786,8 @@ extract_email_record (EContactEditor *editor, gint record, gchar **address, gint
 	email_entry = e_builder_get_widget (editor->builder, widget_name);
 	g_free (widget_name);
 
-	*address  = g_strdup (gtk_entry_get_text (GTK_ENTRY (email_entry)));
+	text = gtk_entry_get_text (GTK_ENTRY (email_entry));
+	*address  = g_strstrip (g_strdup (text));
 	*location = gtk_combo_box_get_active (GTK_COMBO_BOX (location_combo_box));
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]