-rw-r--r-- | parsing.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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; |