Skip to content

Commit

Permalink
Fix multiline strip_comments logic
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
basile-henry authored and romkatv committed Feb 13, 2022
1 parent 5860a42 commit 0ad3d77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/config_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 0ad3d77

Please sign in to comment.