From 0ad3d776aa86dd607dc86dcd7f77ad3ed7ebec61 Mon Sep 17 00:00:00 2001 From: Basile Henry Date: Thu, 9 Sep 2021 21:53:45 +0200 Subject: [PATCH] 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). --- src/config_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config_parse.c b/src/config_parse.c index ed2c87f6bcf..4dacfd6fb4c 100644 --- a/src/config_parse.c +++ b/src/config_parse.c @@ -351,7 +351,7 @@ static int parse_multiline_variable(git_config_parser *reader, git_buf *value, i } /* If it was just a comment, pretend it didn't exist */ - quote_count = strip_comments(line, !!in_quotes); + quote_count = strip_comments(line, in_quotes); if (line[0] == '\0') goto next;