summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ba7e814)
raw | patch | inline | side by side (parent: ba7e814)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 14 Oct 2009 18:51:03 +0000 (11:51 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 15 Oct 2009 06:47:03 +0000 (23:47 -0700) |
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>
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>
commit.c | patch | blob | history |
diff --git a/commit.c b/commit.c
index aa3b35b6a86891ac9d0628e20a6a46d506bf7700..eee5ab803b973f879cf59a93d820416efbf4e9ef 100644 (file)
--- a/commit.c
+++ b/commit.c
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) {