Skip to content

Commit 0ad3d77

Browse files
basile-henryromkatv
authored andcommitted
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 5860a42 commit 0ad3d77

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
@@ -351,7 +351,7 @@ static int parse_multiline_variable(git_config_parser *reader, git_buf *value, i
351351
}
352352

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

0 commit comments

Comments
 (0)