From e2d769b29016dcb4e2294646f52a09d777a724d1 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Mon, 20 Feb 2006 21:26:22 +0000 Subject: [PATCH] Fix the e-mail address escaping This patch makes StGIT only escape the quotes in an e-mail address since passing them unescaped as GIT_* environment variables can cause problems. Signed-off-by: Catalin Marinas --- stgit/commands/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stgit/commands/common.py b/stgit/commands/common.py index f7301da..2e1ba7a 100644 --- a/stgit/commands/common.py +++ b/stgit/commands/common.py @@ -136,7 +136,7 @@ def name_email(address): """Return a tuple consisting of the name and email parsed from a standard 'name ' string """ - address = re.sub('([^\w\s<>@.])', '\\\\\\1', address) + address = re.sub('[\\\\"]', '\\\\\g<0>', address) str_list = re.findall('^(.*)\s*<(.*)>\s*$', address) if not str_list: raise CmdException, 'Incorrect "name " string: %s' % address @@ -147,7 +147,7 @@ def name_email_date(address): """Return a tuple consisting of the name, email and date parsed from a 'name date' string """ - address = re.sub('([^\w\s<>@.])', '\\\\\\1', address) + address = re.sub('[\\\\"]', '\\\\\g<0>', address) str_list = re.findall('^(.*)\s*<(.*)>\s*(.*)\s*$', address) if not str_list: raise CmdException, 'Incorrect "name date" string: %s' % address -- 2.11.0