Luke Shumaker
dda9bff3c5
fast-export: do not modify memory from get_commit_buffer
...
fast-export's helper function find_encoding() takes a `const char *`, but
modifies that memory despite the `const`. Ultimately, this memory came
from get_commit_buffer(), and you're not supposed to modify the memory
that you get from get_commit_buffer().
So, get rid of find_encoding() in favor of commit.h:find_commit_header(),
which gives back a string length, rather than mutating the memory to
insert a '\0' terminator.
Because find_commit_header() detects the "\n\n" string that separates the
headers and the commit message, move the call to be above the
`message = strstr(..., "\n\n")` call. This helps readability, and allows
for the value of `encoding` to be used for a better value of "..." so that
the same memory doesn't need to be checked twice. Introduce a
`commit_buffer_cursor` variable to avoid writing an awkward
`encoding ? encoding + encoding_len : committer_end` expression.
Signed-off-by: Luke Shumaker <lukeshu@datawire.io >
Signed-off-by: Christian Couder <chriscool@tuxfamily.org >
Signed-off-by: Junio C Hamano <gitster@pobox.com >
2025-03-10 13:24:56 -07:00
..
2024-12-06 20:20:04 +09:00
2025-01-28 13:02:22 -08:00
2024-10-25 14:02:36 -04:00
2024-09-13 14:32:24 -07:00
2024-10-11 09:37:18 -07:00
2025-02-18 15:30:31 -08:00
2024-12-06 20:20:02 +09:00
2025-01-21 08:44:54 -08:00
2025-01-29 14:05:09 -08:00
2024-12-18 10:44:31 -08:00
2024-12-13 07:33:36 -08:00
2024-12-23 09:32:11 -08:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-09-23 10:35:09 -07:00
2025-01-17 13:30:03 -08:00
2025-01-17 13:30:03 -08:00
2025-01-17 13:30:03 -08:00
2024-12-23 09:32:11 -08:00
2024-12-06 20:20:02 +09:00
2025-02-06 12:26:42 -08:00
2024-09-13 14:32:24 -07:00
2024-12-18 10:44:30 -08:00
2025-01-17 13:30:03 -08:00
2025-01-29 14:05:09 -08:00
2024-11-26 10:36:08 +09:00
2024-12-04 08:21:54 +09:00
2025-01-28 13:02:24 -08:00
2024-11-01 12:53:19 -04:00
2024-09-13 14:32:24 -07:00
2025-01-28 13:02:22 -08:00
2024-12-23 09:32:11 -08:00
2024-12-18 10:44:31 -08:00
2025-01-17 13:30:03 -08:00
2025-01-17 13:30:03 -08:00
2025-01-17 13:30:03 -08:00
2024-12-06 20:20:02 +09:00
2025-02-06 13:00:21 -08:00
2025-03-10 13:24:56 -07:00
2025-02-10 10:18:31 -08:00
2025-01-17 13:30:03 -08:00
2025-01-27 08:16:47 -08:00
2024-09-23 10:35:09 -07:00
2025-01-21 09:06:24 -08:00
2024-12-06 20:20:04 +09:00
2024-12-18 10:44:30 -08:00
2025-01-17 13:30:03 -08:00
2025-02-12 10:08:53 -08:00
2025-01-17 13:30:03 -08:00
2025-01-01 14:13:01 -08:00
2024-09-13 14:32:24 -07:00
2024-12-18 10:44:30 -08:00
2024-11-26 10:36:08 +09:00
2025-02-10 10:18:31 -08:00
2024-11-21 08:23:45 +09:00
2024-10-14 12:33:02 -04:00
2025-01-21 08:44:54 -08:00
2025-01-17 13:30:03 -08:00
2024-11-04 22:37:51 -08:00
2024-09-13 14:32:24 -07:00
2024-12-18 10:44:31 -08:00
2025-01-17 13:30:03 -08:00
2024-12-27 08:12:40 -08:00
2024-12-06 20:20:02 +09:00
2025-01-17 13:30:03 -08:00
2025-01-17 13:30:03 -08:00
2025-01-17 13:30:03 -08:00
2024-12-06 20:20:04 +09:00
2025-01-17 13:30:03 -08:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-12-04 10:32:20 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-11-26 10:36:08 +09:00
2025-02-12 10:08:51 -08:00
2025-01-17 13:30:03 -08:00
2024-12-06 20:20:03 +09:00
2025-01-31 10:06:11 -08:00
2024-09-13 14:33:30 -07:00
2024-12-18 10:44:30 -08:00
2024-12-06 20:20:04 +09:00
2025-02-04 09:51:41 -08:00
2024-12-23 09:32:17 -08:00
2024-09-13 14:32:24 -07:00
2025-01-17 13:30:03 -08:00
2025-02-10 10:18:31 -08:00
2024-12-06 20:20:03 +09:00
2024-12-04 10:14:47 +09:00
2025-01-17 13:30:03 -08:00
2025-01-17 13:30:03 -08:00
2025-02-12 10:08:54 -08:00
2025-02-12 10:08:52 -08:00
2024-11-21 07:59:14 +09:00
2025-02-06 12:23:54 -08:00
2024-12-06 20:20:04 +09:00
2024-12-06 20:20:03 +09:00
2025-02-05 09:32:01 -08:00
2025-01-17 13:30:03 -08:00
2024-12-06 20:20:03 +09:00
2024-12-06 20:20:02 +09:00
2024-12-18 10:44:30 -08:00
2024-12-06 20:20:03 +09:00
2024-12-06 20:20:02 +09:00
2025-01-31 09:44:16 -08:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:04 +09:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:04 +09:00
2024-09-13 14:32:24 -07:00
2025-01-21 09:06:24 -08:00
2025-01-17 13:30:03 -08:00
2025-01-31 10:06:11 -08:00
2025-01-17 13:30:03 -08:00
2024-12-06 20:20:02 +09:00
2025-02-10 16:20:21 -08:00
2025-01-17 13:30:03 -08:00
2024-12-18 10:44:30 -08:00
2025-01-28 13:02:22 -08:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2025-01-21 09:06:24 -08:00
2024-12-23 09:32:11 -08:00
2024-09-23 10:35:09 -07:00