mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-19 12:16:36 +00:00
Merge pull request #1644 from carlosmn/sig-isspace
signature: extend trimming to more whitespace
This commit is contained in:
commit
9d4db41a8f
@ -35,11 +35,11 @@ static bool contains_angle_brackets(const char *input)
|
||||
|
||||
static char *extract_trimmed(const char *ptr, size_t len)
|
||||
{
|
||||
while (len && ptr[0] == ' ') {
|
||||
while (len && git__isspace(ptr[0])) {
|
||||
ptr++; len--;
|
||||
}
|
||||
|
||||
while (len && ptr[len - 1] == ' ') {
|
||||
while (len && git__isspace(ptr[len - 1])) {
|
||||
len--;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,8 @@ static void assert_name_and_email(
|
||||
void test_commit_signature__leading_and_trailing_spaces_are_trimmed(void)
|
||||
{
|
||||
assert_name_and_email("nulltoken", "emeric.fermas@gmail.com", " nulltoken ", " emeric.fermas@gmail.com ");
|
||||
assert_name_and_email("nulltoken", "emeric.fermas@gmail.com", " nulltoken ", " emeric.fermas@gmail.com \n");
|
||||
assert_name_and_email("nulltoken", "emeric.fermas@gmail.com", " \t nulltoken \n", " \n emeric.fermas@gmail.com \n");
|
||||
}
|
||||
|
||||
void test_commit_signature__angle_brackets_in_names_are_not_supported(void)
|
||||
|
Loading…
Reference in New Issue
Block a user