summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--parsing.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/parsing.c b/parsing.c
index 4420e58..b86467a 100644
--- a/parsing.c
+++ b/parsing.c
@@ -236,3 +236,6 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
t = strchr(p, '\n');
- if (t && *t) {
+ if (t) {
+ if (*t == '\0')
+ ret->subject = strdup("** empty **");
+ else
ret->subject = substr(p, t);
@@ -243,3 +246,5 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
ret->msg = p;
- }
+ } else
+ ret->subject = substr(p, p+strlen(p));
+
return ret;