X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=commit.c;h=51839fbedb1cb19f3d0cb11c60c7b9f695975654;hb=905bf7742cf5f4a6dea2e75ba2dbd89d5dfaa793;hp=471efb0566368aaf589d6d8390d583bc21bed256;hpb=354870171bc98dfef7dfa037b3fe9ac9454c94a2;p=git.git diff --git a/commit.c b/commit.c index 471efb056..51839fbed 100644 --- a/commit.c +++ b/commit.c @@ -132,8 +132,8 @@ struct commit_graft *read_graft_line(char *buf, int len) int i; struct commit_graft *graft = NULL; - if (buf[len-1] == '\n') - buf[--len] = 0; + while (len && isspace(buf[len-1])) + buf[--len] = '\0'; if (buf[0] == '#' || buf[0] == '\0') return NULL; if ((len + 1) % 41) {