strbuf: remove global variable
As a library that only interacts with other primitives, strbuf should not utilize the comment_line_char global variable within its functions. Therefore, add an additional parameter for functions that use comment_line_char and refactor callers to pass it in instead. strbuf_stripspace() removes the skip_comments boolean and checks if comment_line_char is a non-NUL character to determine whether to skip comments or not. Signed-off-by: Calvin Wan <calvinwan@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
aba0706832
commit
787cb8a48a
@ -1283,7 +1283,7 @@ static int parse_mail(struct am_state *state, const char *mail)
|
||||
|
||||
strbuf_addstr(&msg, "\n\n");
|
||||
strbuf_addbuf(&msg, &mi.log_message);
|
||||
strbuf_stripspace(&msg, 0);
|
||||
strbuf_stripspace(&msg, '\0');
|
||||
|
||||
assert(!state->author_name);
|
||||
state->author_name = strbuf_detach(&author_name, NULL);
|
||||
|
||||
Reference in New Issue
Block a user