Skip to content

Commit 3cadd6f

Browse files
committed
Fixed a case were values containing \\" were not properly escaped
1 parent 2b7975c commit 3cadd6f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git/config.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,14 @@ def _read(self, fp, fpname):
254254
if not escaped and c == '"':
255255
in_quote = not in_quote
256256
else:
257-
escaped = (c == '\\')
257+
escaped = (c == '\\') and not escaped
258258
unquoted_optval += c
259259

260+
if in_quote:
261+
if not e:
262+
e = cp.ParsingError(fpname)
263+
e.append(lineno, repr(line))
264+
260265
optval = unquoted_optval
261266

262267
optval = optval.replace('\\\\', '\\') # Unescape backslashes

0 commit comments

Comments
 (0)