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.tokkee.org/?a=commitdiff_plain;h=684958ae6162c593bd90ba893271ffb2381c3c44;p=git.git When showing a commit message, do not lose an incomplete line. --- 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; }