aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;