[Xfce4-commits] <postler:master> Handle quotes as part of names
Christian Dywan
noreply at xfce.org
Thu Mar 3 00:14:03 CET 2011
Updating branch refs/heads/master
to 842120623a8a6679af9e0bd2282845de88c6c941 (commit)
from 745defc61f990724b8f6afc66571e9e6158a543d (commit)
commit 842120623a8a6679af9e0bd2282845de88c6c941
Author: Christian Dywan <christian at twotoasts.de>
Date: Wed Mar 2 23:44:00 2011 +0100
Handle quotes as part of names
postler/postler-messages.vala | 1 +
tests/parsing.vala | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/postler/postler-messages.vala b/postler/postler-messages.vala
index 487266c..a1d9510 100644
--- a/postler/postler-messages.vala
+++ b/postler/postler-messages.vala
@@ -451,6 +451,7 @@ public class Postler.Messages : Gtk.TreeView {
/* Remove double or single quotes around the name */
long first = address.has_prefix ("'") || address.has_prefix ("\"") ? 1 : 0;
return { address.substring (first, lower - 1)
+ .replace ("\\\"", "`")
.replace ("' ", "").replace ("\"", "").chomp (), recipient };
}
diff --git a/tests/parsing.vala b/tests/parsing.vala
index b93ae01..c1a66b4 100644
--- a/tests/parsing.vala
+++ b/tests/parsing.vala
@@ -68,6 +68,7 @@ const TestCase[] addresses = {
{ "\"Klaus\" <klaus at heim.at>", "Klaus klaus at heim.at" },
{ "Bert O'Brian <bert+ at uni.edu>", "Bert O'Brian bert+ at uni.edu" },
{ "\"gtk+\" (b.g.o) <b at g.o>", "gtk+ (b.g.o) b at g.o" },
+ { "\"S \\\"T\\\" D\" <t at u.com>", "S `T` D t at u.com" },
{ "=?iso-8859-1?Q?M=2C_Alf?= <alf.m at vw.de>",
"=?iso-8859-1?Q?M=2C_Alf?= alf.m at vw.de" }
};
More information about the Xfce4-commits
mailing list