summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--parsing.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/parsing.c b/parsing.c
index 4420e58..b86467a 100644
--- a/parsing.c
+++ b/parsing.c
@@ -236,4 +236,7 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
t = strchr(p, '\n');
- if (t && *t) {
- ret->subject = substr(p, t);
+ if (t) {
+ if (*t == '\0')
+ ret->subject = strdup("** empty **");
+ else
+ ret->subject = substr(p, t);
p = t + 1;
@@ -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;