about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--parsing.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/parsing.c b/parsing.c
index 4173dd4..4412dee 100644
--- a/parsing.c
+++ b/parsing.c
@@ -145,6 +145,12 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
 
 	ret = xmalloc(sizeof(*ret));
 	ret->commit = commit;
+	ret->author = NULL;
+	ret->author_email = NULL;
+	ret->committer = NULL;
+	ret->committer_email = NULL;
+	ret->subject = NULL;
+	ret->msg = NULL;
 
 	if (strncmp(p, "tree ", 5))
 		die("Bad commit: %s", sha1_to_hex(commit->object.sha1));
@@ -180,12 +186,13 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
 		p = strchr(p, '\n') + 1;
 
 	t = strchr(p, '\n');
-	ret->subject = substr(p, t);
-	p = t + 1;
-
-	while (*p == '\n')
-		p = strchr(p, '\n') + 1;
-	ret->msg = p;
+	if (t && *t) {
+		ret->subject = substr(p, t);
+		p = t + 1;
 
+		while (*p == '\n')
+			p = strchr(p, '\n') + 1;
+		ret->msg = p;
+	}
 	return ret;
 }
td>June McEnroe 2019-02-10Generate html for binsJune McEnroe 2019-02-10Use italic for underline in nvim man modeJune McEnroe This doesn't yet work in Terminal.app: <https://github.com/neovim/neovim/issues/9598>. 2019-02-10Add plain text "language" to hiJune McEnroe 2019-02-10Don't match DQ string inside SQ stringJune McEnroe 2019-02-10Skip only one character if a match fails due to parentJune McEnroe Really it should skip forward until the parent changes, but this is simpler. 2019-02-10Remove pattend from hiJune McEnroe 2019-02-10Replace uses of pattend with newline patternsJune McEnroe 2019-02-10Add hi debug outputJune McEnroe 2019-02-10Actually do HTML &quot; escapingJune McEnroe 2019-02-10Set git commit.verboseJune McEnroe 2019-02-10Add back missing static keywordJune McEnroe