diff --git a/commit.c b/commit.c
index 471efb0566368aaf589d6d8390d583bc21bed256..51839fbedb1cb19f3d0cb11c60c7b9f695975654 100644 (file)
--- a/commit.c
+++ b/commit.c
int i;
struct commit_graft *graft = NULL;
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) {
if (buf[0] == '#' || buf[0] == '\0')
return NULL;
if ((len + 1) % 41) {