Files
git-mirror/trace2
Christian Couder 8afd0ee95a strbuf: refactor strbuf_trim_trailing_ch()
We often have to split strings at some specified terminator character.
The strbuf_split*() functions, that we can use for this purpose,
return substrings that include the terminator character, so we often
need to remove that character.

When it is a whitespace, newline or directory separator, the
terminator character can easily be removed using an existing triming
function like strbuf_rtrim(), strbuf_trim_trailing_newline() or
strbuf_trim_trailing_dir_sep(). There is no function to remove that
character when it's not one of those characters though.

Let's introduce a new strbuf_trim_trailing_ch() function that can be
used to remove any trailing character, and let's refactor existing code
that manually removed trailing characters using this new function.

We are also going to use this new function in a following commit.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-10 10:40:57 -07:00
..
2022-10-24 12:45:26 -07:00
2023-06-28 14:06:39 -07:00
2023-06-28 14:06:39 -07:00
2022-10-24 12:45:26 -07:00