aboutsummaryrefslogtreecommitdiffstats
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
parent275814ec8889e54665e0d1f2a665a37933520c59 (diff)
downloadgsoc2013-evolution-28c50b7cb8dfb17659c6043c48d5cc03be537154.tar
gsoc2013-evolution-28c50b7cb8dfb17659c6043c48d5cc03be537154.tar.gz
gsoc2013-evolution-28c50b7cb8dfb17659c6043c48d5cc03be537154.tar.bz2
gsoc2013-evolution-28c50b7cb8dfb17659c6043c48d5cc03be537154.tar.lz
gsoc2013-evolution-28c50b7cb8dfb17659c6043c48d5cc03be537154.tar.xz
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
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/message-list.c11
2 files changed, 16 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 09264e2616..b04ad0d151 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2000-09-23 Ettore Perazzoli <ettore@helixcode.com>
+
+ * message-list.c (internet_address_new_from_string): Skip spaces
+ at the beginning of the string first before doing anything else.
+ The code that follows doesn't like the first character of the
+ string to be a space.
+
2000-09-22 Jeffrey Stedfast <fejj@helixcode.com>
* message-list.c (address_compare): New comparison function for
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;