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:
authorLinus Arver <linusa@google.com>2023-10-20 22:01:35 +0300
committerJunio C Hamano <gitster@pobox.com>2023-12-20 22:55:04 +0300
commitde7c27a1869953158436e60542ea556d78c3f4c2 (patch)
tree7e41270d3513327b9d95fe109fdbeabc9eeebe9c /sequencer.c
parent97e9d0b78a038de37245acbef11a10c4ae2feeb3 (diff)
trailer: use offsets for trailer_start/trailer_end
Previously these fields in the trailer_info struct were of type "const char *" and pointed to positions in the input string directly (to the start and end positions of the trailer block). Use offsets to make the intended usage less ambiguous. We only need to reference the input string in format_trailer_info(), so update that function to take a pointer to the input. While we're at it, rename trailer_start to trailer_block_start to be more explicit about these offsets (that they are for the entire trailer block including other trailers). Ditto for trailer_end. Reported-by: Glen Choo <glencbz@gmail.com> Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c
index d584cac8ed..8707a92204 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -345,7 +345,7 @@ static int has_conforming_footer(struct strbuf *sb, struct strbuf *sob,
if (ignore_footer)
sb->buf[sb->len - ignore_footer] = saved_char;
- if (info.trailer_start == info.trailer_end)
+ if (info.trailer_block_start == info.trailer_block_end)
return 0;
for (i = 0; i < info.trailer_nr; i++)