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 <catalin.marinas@gmail.com>
"""Return a tuple consisting of the name and email parsed from a
standard 'name <email>' string
"""
"""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
str_list = re.findall('^(.*)\s*<(.*)>\s*$', address)
if not str_list:
raise CmdException, 'Incorrect "name <email>" string: %s' % address
"""Return a tuple consisting of the name, email and date parsed
from a 'name <email> date' string
"""
"""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
str_list = re.findall('^(.*)\s*<(.*)>\s*(.*)\s*$', address)
if not str_list:
raise CmdException, 'Incorrect "name <email> date" string: %s' % address