strbuf: accept a comment string for strbuf_add_commented_lines()

As part of our transition to multi-byte comment characters, let's take a
NUL-terminated string pointer for strbuf_add_commented_lines() rather
than a single character.

All of the callers have to be adjusted; most can just pass
comment_line_str rather than comment_line_char.

And now our "cheat" in strbuf_commented_addf() can go away, as we can
take the full string from it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2024-03-12 05:17:32 -04:00
committed by Junio C Hamano
parent 3a35d96284
commit a1bb146aaf
8 changed files with 21 additions and 31 deletions

View File

@ -13,7 +13,7 @@ static void comment_lines(struct strbuf *buf)
size_t len;
msg = strbuf_detach(buf, &len);
strbuf_add_commented_lines(buf, msg, len, comment_line_char);
strbuf_add_commented_lines(buf, msg, len, comment_line_str);
free(msg);
}