From: Alfons Hoogervorst Date: Sun, 27 May 2001 12:27:55 +0000 (+0000) Subject: skip quoted email addresses in textview:get_email_part() X-Git-Tag: VERSION_0_5_0~125 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=846e3d98baacd972c4522b611bc576cfab3c8bdb skip quoted email addresses in textview:get_email_part() --- diff --git a/ChangeLog.claws b/ChangeLog.claws index d57905f02..3734ba6da 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,10 @@ +2001-05-27 [alfons] + + * src/textview.c: + + (get_email_part): skip quoted email addresses, like in e.g. + "'alfons@proteus.demon.nl'". + 2001-05-26 [alfons] Minor GUI fixes adding horizontal scrollbars to Hoa's matcher dialogs, diff --git a/src/textview.c b/src/textview.c index af4110a04..fa44ba929 100644 --- a/src/textview.c +++ b/src/textview.c @@ -473,6 +473,8 @@ static gchar *make_uri_string(const gchar *bp, const gchar *ep) !isspace(ch) && \ !strchr("()<>\"", (ch))) +#define IS_QUOTE(ch) ((ch) == '\'' || (ch) == '"') + /* get_email_part() - retrieves an email address. Returns TRUE if succesful */ static gboolean get_email_part(const gchar *start, const gchar *scanpos, const gchar **bp, const gchar **ep) @@ -522,9 +524,11 @@ static gboolean get_email_part(const gchar *start, const gchar *scanpos, if (!result) return FALSE; - /* we now have at least the address. now see if this is ; in this - * case we also scan for the informative part. we could make this a useful - * function because it tries to parse out an email address backwards. :) */ + /* skip if it's between quotes "'alfons@proteus.demon.nl'" */ + if (bp_ - 1 > start && IS_QUOTE(*(bp_ - 1)) && IS_QUOTE(*ep_)) + return FALSE; + + /* see if this is ; in this case we also scan for the informative part. */ if (bp_ - 1 <= start || *(bp_ - 1) != '<' || *ep_ != '>') return TRUE; @@ -588,6 +592,7 @@ static gboolean get_email_part(const gchar *start, const gchar *scanpos, return result; } +#undef IS_QUOTE #undef IS_RFC822_CHAR static gchar *make_email_string(const gchar *bp, const gchar *ep)