[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-devel] [PATCH] Re: [sup-talk] Bug reading/writing contacts with \" in them



Hi Ico,

Excerpts from Ico's message of 2011-01-24 06:20:47 +0100:
> The problem occurs when contacts have a certain combination of backslashes and
> quotes in them. I 'imported' my mutt aliases with a simple script converting
> the format (too bad it is *almost* the same but not quite), and one of the
> contacts looked like this:
> 
>   somename: \"Some, Name\" <somename@somedomain.com>
As discussed on IRC, I’ve made the following findings:

 • Some combinations of email addresses (phrase + addr-spec in RFC822
   terminology) need to be escaped, for example when they contain a comma or a
   quote.
 • This escaping happens in Person#full_address by using @name.inspect
 • Person#full_address also is used when saving contacts back to contacts.txt
 • Person#initialize partly strips the quotes (line 10/11), but does not handle
   backslashes.

Attached is a patch which fixes the issue. Input like "Rob, Post\" will first
be turned into "Rob, Post\\" when initially escaping, but will then stay "Rob,
Post\\" (no more exploding backslashes).

Best regards,
Michael

Attachment: 0001-Bugfix-Un-escape-slashes-when-initializing-a-new-Per.patch
Description: Binary data

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel