From: Linus Torvalds Date: Wed, 12 Apr 2006 18:31:23 +0000 (-0700) Subject: When showing a commit message, do not lose an incomplete line. X-Git-Tag: v1.3.0-rc4~16^2^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/684958ae6162c593bd90ba893271ffb2381c3c44?ds=inline;hp=--cc When showing a commit message, do not lose an incomplete line. --- 684958ae6162c593bd90ba893271ffb2381c3c44 diff --git a/commit.c b/commit.c index d534c9ba58..c7bb8dba64 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; }