Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin Wan <calvinwan@google.com>2023-06-06 22:48:43 +0300
committerJunio C Hamano <gitster@pobox.com>2023-06-12 23:49:36 +0300
commit787cb8a48ae24ff07fa7c763909bb204bfdc84a7 (patch)
tree3f5081154dbc5b8fedb73cac218d581065637bcc /gpg-interface.c
parentaba070683295a20bdf4f49146384984961c794b2 (diff)
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>
Diffstat (limited to 'gpg-interface.c')
-rw-r--r--gpg-interface.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gpg-interface.c b/gpg-interface.c
index 19a3471a0b..6a3817bbca 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -13,6 +13,7 @@
#include "tempfile.h"
#include "alias.h"
#include "wrapper.h"
+#include "environment.h"
static int git_gpg_config(const char *, const char *, void *);
@@ -586,8 +587,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, '\0');
+ strbuf_stripspace(&ssh_keygen_err, '\0');
/* 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);