config: fix py3 backslash escaping bug in parser caught by tests
authorAugie Fackler <augie@google.com>
Fri, 27 Apr 2018 13:37:10 -0400
changeset 37936 48378d0e9479
parent 37935 630429dcc397
child 37937 a2cfea193040
config: fix py3 backslash escaping bug in parser caught by tests Differential Revision: https://phab.mercurial-scm.org/D3525
mercurial/config.py
--- a/mercurial/config.py	Fri Apr 27 13:27:18 2018 -0400
+++ b/mercurial/config.py	Fri Apr 27 13:37:10 2018 -0400
@@ -215,7 +215,7 @@
             parts.append('')
         if s[offset:offset + 1] == '"' and not parts[-1]:
             return _parse_quote, parts, offset + 1
-        elif s[offset:offset + 1] == '"' and parts[-1][-1] == '\\':
+        elif s[offset:offset + 1] == '"' and parts[-1][-1:] == '\\':
             parts[-1] = parts[-1][:-1] + s[offset:offset + 1]
             return _parse_plain, parts, offset + 1
         parts[-1] += s[offset:offset + 1]