summaryrefslogtreecommitdiffstats
path: root/gpg-interface.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2024-03-12 10:17:27 +0100
committerJunio C Hamano <gitster@pobox.com>2024-03-12 21:28:10 +0100
commit2982b65690d7a043275558c74202a89b0450cbf5 (patch)
tree06ec4677fd4df56aebbf839f54e805c68bd8cc1a /gpg-interface.c
parentenvironment: store comment_line_char as a string (diff)
downloadgit-2982b65690d7a043275558c74202a89b0450cbf5.tar.xz
git-2982b65690d7a043275558c74202a89b0450cbf5.zip
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 'gpg-interface.c')
-rw-r--r--gpg-interface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gpg-interface.c b/gpg-interface.c
index 95e764acb1..b5993385ff 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -586,8 +586,8 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,
}
}
- strbuf_stripspace(&ssh_keygen_out, '\0');
- strbuf_stripspace(&ssh_keygen_err, '\0');
+ strbuf_stripspace(&ssh_keygen_out, NULL);
+ strbuf_stripspace(&ssh_keygen_err, NULL);
/* Add stderr outputs to show the user actual ssh-keygen errors */
strbuf_add(&ssh_keygen_out, ssh_principals_err.buf, ssh_principals_err.len);
strbuf_add(&ssh_keygen_out, ssh_keygen_err.buf, ssh_keygen_err.len);