aboutsummaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2006-04-12 11:31:23 -0700
committerJunio C Hamano <junkio@cox.net>2006-04-12 11:31:23 -0700
commit684958ae6162c593bd90ba893271ffb2381c3c44 (patch)
treed3683319d78fb75d0d94cb2840768f401cba47e0 /commit.c
parent5ca64e488fcf4574fd1b52f7d523d9f31fbead4f (diff)
downloadgit-684958ae6162c593bd90ba893271ffb2381c3c44.tar.gz
git-684958ae6162c593bd90ba893271ffb2381c3c44.tar.xz
When showing a commit message, do not lose an incomplete line.
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 d534c9ba5..c7bb8dba6 100644
--- a/commit.c
+++ b/commit.c
@@ -400,11 +400,11 @@ static int get_one_line(const char *msg, unsigned long len)
while (len--) {
char c = *msg++;
+ if (!c)
+ break;
ret++;
if (c == '\n')
break;
- if (!c)
- return 0;
}
return ret;
}