aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-09-23 22:29:35 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-09-23 22:29:35 +0800
commit28c50b7cb8dfb17659c6043c48d5cc03be537154 (patch)
tree569eca306c1ae5e16ed3dab11e4d2ea8e086f5f4 /mail/message-list.c
parent275814ec8889e54665e0d1f2a665a37933520c59 (diff)
downloadgsoc2013-evolution-28c50b7cb8dfb17659c6043c48d5cc03be537154.tar.gz
gsoc2013-evolution-28c50b7cb8dfb17659c6043c48d5cc03be537154.tar.zst
gsoc2013-evolution-28c50b7cb8dfb17659c6043c48d5cc03be537154.zip
Fix a crash that happened on my system when sorting by the "From"
field. (The address parsing code failed miserably if the first character was a space.) svn path=/trunk/; revision=5559
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index e0694cbc6b..4fc773e77e 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -124,15 +124,22 @@ internet_address_new_from_string (const gchar *string)
*/
InternetAddress *ia;
gchar *name = NULL, *address = NULL;
- gchar *ptr, *padding = NULL;
+ const gchar *ptr;
+ const gchar *padding;
gboolean in_quotes = FALSE;
gboolean name_first = FALSE;
g_return_val_if_fail (string != NULL, NULL);
g_return_val_if_fail (*string != '\0', NULL);
+
+ padding = NULL;
+
+ ptr = string;
+ while (isspace (*ptr))
+ ptr++;
/* look for padding between parts... */
- for (ptr = (gchar *) string; *ptr; ptr++) {
+ for (; *ptr; ptr++) {
if (*ptr == '"') {
in_quotes = !in_quotes;
name_first = TRUE;