Match existing INI file entry with leading whitespace (fixes #4997) (#4998)

This commit is contained in:
Andrew Gaffney 2016-09-26 07:58:14 -06:00 committed by Matt Clay
commit 460b0e1ab6

View file

@ -108,7 +108,7 @@ import re
def match_opt(option, line): def match_opt(option, line):
option = re.escape(option) option = re.escape(option)
return re.match('%s( |\t)*=' % option, line) \ return re.match(' *%s( |\t)*=' % option, line) \
or re.match('# *%s( |\t)*=' % option, line) \ or re.match('# *%s( |\t)*=' % option, line) \
or re.match('; *%s( |\t)*=' % option, line) or re.match('; *%s( |\t)*=' % option, line)
@ -117,7 +117,7 @@ def match_opt(option, line):
def match_active_opt(option, line): def match_active_opt(option, line):
option = re.escape(option) option = re.escape(option)
return re.match('%s( |\t)*=' % option, line) return re.match(' *%s( |\t)*=' % option, line)
# ============================================================== # ==============================================================
# do_ini # do_ini