aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c20
2 files changed, 17 insertions, 9 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 2cb8dc355a..f782fd9b17 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,11 @@
2001-08-16 Jon Trowbridge <trow@ximian.com>
+ * gui/contact-editor/e-contact-quick-add.c (e_contact_quick_add):
+ Check that name != NULL before we start messing with it.
+ (Fixes bug #7329)
+
+2001-08-16 Jon Trowbridge <trow@ximian.com>
+
* gui/component/select-names/e-select-names-completion.c
(match_nickname): Boost scoring on an exact nickname match.
Manually addressify match.
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c
index a94153720f..27755d980a 100644
--- a/addressbook/gui/contact-editor/e-contact-quick-add.c
+++ b/addressbook/gui/contact-editor/e-contact-quick-add.c
@@ -318,7 +318,7 @@ e_contact_quick_add (const gchar *in_name, const gchar *email,
{
QuickAdd *qa;
GtkWidget *dialog;
- gchar *name;
+ gchar *name = NULL;
gint len;
/* We need to have *something* to work with. */
@@ -328,16 +328,18 @@ e_contact_quick_add (const gchar *in_name, const gchar *email,
return;
}
- name = g_strdup (in_name);
+ if (in_name) {
+ name = g_strdup (in_name);
- /* Remove extra whitespace and the quotes some mailers put around names. */
- g_strstrip (name);
- len = strlen (name);
- if ((name[0] == '\'' && name[len-1] == '\'') || (name[0] == '"' && name[len-1] == '"')) {
- name[0] = ' ';
- name[len-1] = ' ';
+ /* Remove extra whitespace and the quotes some mailers put around names. */
+ g_strstrip (name);
+ len = strlen (name);
+ if ((name[0] == '\'' && name[len-1] == '\'') || (name[0] == '"' && name[len-1] == '"')) {
+ name[0] = ' ';
+ name[len-1] = ' ';
+ }
+ g_strstrip (name);
}
- g_strstrip (name);
qa = quick_add_new ();
qa->cb = cb;