summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-10-14 18:51:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-10-15 06:47:03 (GMT)
commitfe0a3cb23c7930be419937825591388465ceb47f (patch)
tree722c7746cc498a2d190daef0716e8a0e2aa2a369 /commit.c
parentba7e81430a32614982172c7064c01db43f55b4bb (diff)
downloadgit-fe0a3cb23c7930be419937825591388465ceb47f.zip
git-fe0a3cb23c7930be419937825591388465ceb47f.tar.gz
git-fe0a3cb23c7930be419937825591388465ceb47f.tar.bz2
info/grafts: allow trailing whitespaces at the end of line
When creating an info/grafts under windows, one typically gets a CRLF file. There is no good reason to forbid trailing CR at the end of the line (for that matter, any trailing whitespaces); the code allowed only LF simply because that was good enough for the platforms with LF line endings. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/commit.c b/commit.c
index aa3b35b..eee5ab8 100644
--- a/commit.c
+++ b/commit.c
@@ -136,8 +136,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) {