From 684958ae6162c593bd90ba893271ffb2381c3c44 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 12 Apr 2006 11:31:23 -0700 Subject: [PATCH] When showing a commit message, do not lose an incomplete line. --- commit.c | 4 ++-- 1 file 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; } -- 2.26.2