]> granicus.if.org Git - cgit/commitdiff
Set msg_encoding according to the header.
authorJonathan Bastien-Filiatrault <joe@x2a.org>
Fri, 26 Oct 2007 22:10:26 +0000 (18:10 -0400)
committerJonathan Bastien-Filiatrault <joe@x2a.org>
Mon, 5 Nov 2007 23:13:30 +0000 (18:13 -0500)
parsing.c

index 0412a9cbe46b6c1f3c43489bbf23aee601f28c46..16b4db798a46adafba0cd8349748783e4d076395 100644 (file)
--- a/parsing.c
+++ b/parsing.c
@@ -234,6 +234,14 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
                p = strchr(t, '\n') + 1;
        }
 
+       if (!strncmp(p, "encoding ", 9)) {
+               p += 9;
+               t = strchr(p, '\n') + 1;
+               ret->msg_encoding = substr(p, t);
+               p = t;
+       } else
+               ret->msg_encoding = xstrdup(PAGE_ENCODING);
+
        while (*p && (*p != '\n'))
                p = strchr(p, '\n') + 1; // skip unknown header fields