Fix the e-mail address escaping
[stgit] / stgit / commands / common.py
index f7301da..2e1ba7a 100644 (file)
@@ -136,7 +136,7 @@ def name_email(address):
     """Return a tuple consisting of the name and email parsed from a
     standard 'name <email>' 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 <email>" 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 <email> 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 <email> date" string: %s' % address