-int cgit_read_config(const char *filename, configfn fn)
-{
- int ret = 0, len;
- char line[256];
- const char *value;
- FILE *f = fopen(filename, "r");
+ if (!strncmp(p, "committer ", 9)) {
+ p += 9;
+ t = strchr(p, '<') - 1;
+ ret->committer = substr(p, t);
+ p = t;
+ t = strchr(t, '>') + 1;
+ ret->committer_email = substr(p, t);
+ ret->committer_date = atol(t+1);
+ 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
+
+ while (*p == '\n')
+ p = strchr(p, '\n') + 1;