Skip to content

Commit 574c590

Browse files
committed
Fix multiline strip_comments logic
The strip_comments function uses the count of quotes to know if a comment char (';' or '#') is the start of a comment or part of the multiline as a string. Unfortunately converting the count of quotes from previous lines to a boolean meant that it would only work as expected in some cases (0 quotes or an odd number of quotes).
1 parent 5eab4da commit 574c590

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/config_parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static int parse_multiline_variable(git_config_parser *reader, git_buf *value, i
349349
}
350350

351351
/* If it was just a comment, pretend it didn't exist */
352-
quote_count = strip_comments(line, !!in_quotes);
352+
quote_count = strip_comments(line, in_quotes);
353353
if (line[0] == '\0')
354354
goto next;
355355

0 commit comments

Comments
 (0)