diff --git a/mailmap.c b/mailmap.c index 2a7b36628c..418081e613 100644 --- a/mailmap.c +++ b/mailmap.c @@ -122,7 +122,7 @@ static char *parse_name_and_email(char *buffer, char **name, while (nend > nstart && isspace(*nend)) --nend; - *name = (nstart < nend ? nstart : NULL); + *name = (nstart <= nend ? nstart : NULL); *email = left+1; *(nend+1) = '\0'; *right++ = '\0'; diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index 27f8f86ea7..8583724375 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -247,7 +247,7 @@ test_expect_success 'cleanup after mailmap.blob tests' ' rm -f .mailmap ' -test_expect_failure 'single-character name' ' +test_expect_success 'single-character name' ' echo " 1 A " >expect && echo " 1 nick1 " >>expect && echo "A " >.mailmap &&