DORMANTno replies

[PATCH] Handle commit messages without new line at end correctly

From: Fredrik Kuivinen <hidden>
Date: 2016-06-15 22:42:01
Subsystem: the rest · Maintainer: Linus Torvalds

Currently, if a commit message doesn't end with a new line the last
line in the message is omitted from the output. The following patch
fixes this bug.


Signed-Off-By: Fredrik Kuivinen <redacted>
---
diff --git a/commit.c b/commit.c
--- a/commit.c
+++ b/commit.c
@@ -202,11 +202,11 @@ static int get_one_line(const char *msg,
 
 	while (len--) {
 		char c = *msg++;
+		if (!c)
+			break;
 		ret++;
 		if (c == '\n')
 			break;
-		if (!c)
-			return 0;
 	}
 	return ret;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help