diff options
| author | Jeff King <peff@peff.net> | 2024-03-12 05:17:27 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-03-12 13:28:10 -0700 |
| commit | 2982b65690d7a043275558c74202a89b0450cbf5 (patch) | |
| tree | 06ec4677fd4df56aebbf839f54e805c68bd8cc1a /builtin/am.c | |
| parent | 72a7d5d97fe0338719a45787994b04a4170719da (diff) | |
| download | git-2982b65690d7a043275558c74202a89b0450cbf5.tar.gz | |
strbuf: accept a comment string for strbuf_stripspace()
As part of our transition to multi-byte comment characters, let's take a
NUL-terminated string pointer for strbuf_stripspace(), rather than a
single character. We can continue to support its feature of ignoring
comments by accepting a NULL pointer (as opposed to the current behavior
of a NUL byte).
All of the callers have to be adjusted, but they can all just pass
comment_line_str (or NULL).
Inside the function we detect comments by comparing the first byte of a
line to the comment character. We'll adjust that to use starts_with(),
which will match multiple bytes (though for now, of course, we still
only allow a single byte, so it's academic).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/am.c')
| -rw-r--r-- | builtin/am.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/am.c b/builtin/am.c index d1990d7edc..5bc72d7822 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -1286,7 +1286,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, NULL); assert(!state->author_name); state->author_name = strbuf_detach(&author_name, NULL); |
