From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.229.71 with SMTP id jh7cs45826icb; Mon, 24 Jan 2011 10:27:41 -0800 (PST) Received: by 10.42.175.4 with SMTP id ay4mr5185738icb.394.1295893660959; Mon, 24 Jan 2011 10:27:40 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id g6si28073758qcq.192.2011.01.24.10.27.40; Mon, 24 Jan 2011 10:27:40 -0800 (PST) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 5EBD719782DC; Mon, 24 Jan 2011 13:27:40 -0500 (EST) Received: from mx02.rent-a-guru.de (srv2.rent-a-guru.de [212.86.204.162]) by rubyforge.org (Postfix) with ESMTP id F101E1858344; Mon, 24 Jan 2011 13:20:22 -0500 (EST) Received: from infra.in.zekjur.net (infra.in.zekjur.net [79.140.39.194]) (authenticated bits=0) by mx02.rent-a-guru.de (8.13.6/8.13.6) with ESMTP id p0OIKEiS239464223 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 24 Jan 2011 19:20:22 +0100 (CET) Received: from midna.zekjur.net (midna.zekjur.net [IPv6:2001:4d88:1008:4242:21c:c0ff:fe7e:4776]) by infra.in.zekjur.net (Postfix) with ESMTPSA id 7648A4F46F; Mon, 24 Jan 2011 19:20:14 +0100 (CET) Received: by midna.zekjur.net (Postfix, from userid 101) id 9FD8D301903; Mon, 24 Jan 2011 19:20:13 +0100 (CET) From: Michael Stapelberg To: sup-devel In-reply-to: <1295845756-sup-308@pruts.nl> References: <1295845756-sup-308@pruts.nl> Date: Mon, 24 Jan 2011 19:20:13 +0100 Message-Id: <1295892863-sup-1896@midna.zekjur.net> User-Agent: Sup/git Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-1295893213-619550-10619-8985-1-=" Cc: sup-talk Subject: [sup-devel] [PATCH] Re: [sup-talk] Bug reading/writing contacts with \" in them X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org --=-1295893213-619550-10619-8985-1-= Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline 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\" 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 --=-1295893213-619550-10619-8985-1-= Content-Disposition: attachment; filename="0001-Bugfix-Un-escape-slashes-when-initializing-a-new-Per.patch" Content-Type: application/octet-stream; name="0001-Bugfix-Un-escape-slashes-when-initializing-a-new-Per.patch" Content-Transfer-Encoding: base64 RnJvbSAzMThkMWE0Zjg4YTc1Nzc2MTIzNDcxYTY2NTgwNzkyM2M4NDYzZGQw IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBNaWNoYWVsIFN0YXBl bGJlcmcgPG1pY2hhZWxAc3RhcGVsYmVyZy5kZT4KRGF0ZTogTW9uLCAyNCBK YW4gMjAxMSAxOToxODo1NyArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIEJ1Z2Zp eDogVW4tZXNjYXBlIHNsYXNoZXMgd2hlbiBpbml0aWFsaXppbmcgYSBuZXcg UGVyc29uCgpJbiBQZXJzb24jZnVsbF9hZGRyZXNzLCB3ZSBhZGQgc2xhc2hl cyBieSB1c2luZyBAbmFtZS5pbnNwZWN0LCBzbyB3ZSBuZWVkIHRvCnRha2Ug Y2FyZSBvZiB0aGVtIGhlcmUuCi0tLQogbGliL3N1cC9wZXJzb24ucmIgfCAg ICAxICsKIDEgZmlsZXMgY2hhbmdlZCwgMSBpbnNlcnRpb25zKCspLCAwIGRl bGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpYi9zdXAvcGVyc29uLnJiIGIv bGliL3N1cC9wZXJzb24ucmIKaW5kZXggMjg4ODdiMy4uNDU2NjBjMCAxMDA2 NDQKLS0tIGEvbGliL3N1cC9wZXJzb24ucmIKKysrIGIvbGliL3N1cC9wZXJz b24ucmIKQEAgLTksNiArOSw3IEBAIGNsYXNzIFBlcnNvbgogICAgIEBuYW1l ID0gaWYgbmFtZQogICAgICAgbmFtZSA9IG5hbWUuc3RyaXAuZ3N1YigvXHMr LywgIiAiKQogICAgICAgbmFtZSA9fiAvXihbJyJdXHMqKSguKj8pKFxzKlsi J10pJC8gPyAkMiA6IG5hbWUKKyAgICAgIG5hbWUuZ3N1YignXFxcXCcsICdc XCcpCiAgICAgZW5kCiAKICAgICBAZW1haWwgPSBlbWFpbC5zdHJpcC5nc3Vi KC9ccysvLCAiICIpLmRvd25jYXNlCi0tIAoxLjcuMQoK --=-1295893213-619550-10619-8985-1-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel --=-1295893213-619550-10619-8985-1-=--