{"thread":{"id":"1048","subject":"[PATCH] Handle commit messages without new line at end correctly","startedAt":"2005-06-29T21:24:37Z","lastAt":"2005-06-29T21:24:37Z","messageCount":1,"participants":["Fredrik Kuivinen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"5422","messageId":"20050629212437.GA14683@c165.ib.student.liu.se","threadId":"1048","inReplyTo":null,"subject":"[PATCH] Handle commit messages without new line at end correctly","fromName":"Fredrik Kuivinen","fromEmail":"freku045@student.liu.se","sentAt":"2005-06-29T21:24:37Z","receivedAt":"2005-06-29T21:24:37Z","isPatch":true,"sender":{"key":"frekui@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13770967?v=4"},"body":"Currently, if a commit message doesn't end with a new line the last\nline in the message is omitted from the output. The following patch\nfixes this bug.\n\n\nSigned-Off-By: Fredrik Kuivinen <freku045@student.liu.se>\n---\n\ndiff --git a/commit.c b/commit.c\n--- a/commit.c\n+++ b/commit.c\n@@ -202,11 +202,11 @@ static int get_one_line(const char *msg,\n \n \twhile (len--) {\n \t\tchar c = *msg++;\n+\t\tif (!c)\n+\t\t\tbreak;\n \t\tret++;\n \t\tif (c == '\\n')\n \t\t\tbreak;\n-\t\tif (!c)\n-\t\t\treturn 0;\n \t}\n \treturn ret;\n }\n"}]}