all repos — cgit @ 3845e177e4e0b231efb6fda0ac3cd3a2d8f34d4b

a hyperfast web frontend for git written in c

Add commit->msg_encoding, allocate msg dynamicly.
Jonathan Bastien-Filiatrault joe@x2a.org
Fri, 26 Oct 2007 18:09:06 -0400
commit

3845e177e4e0b231efb6fda0ac3cd3a2d8f34d4b

parent

72ede12551af320b6d8eade853dbd2cd6f2222cc

4 files changed, 10 insertions(+), 1 deletions(-)

jump to
M cgit.hcgit.h

@@ -48,6 +48,11 @@ #define TM_YEAR (TM_DAY * 365)

#define TM_MONTH (TM_YEAR / 12.0) +/* + * Default encoding + */ +#define PAGE_ENCODING "UTF-8" + typedef void (*configfn)(const char *name, const char *value); typedef void (*filepair_fn)(struct diff_filepair *pair); typedef void (*linediff_fn)(char *line, int len);

@@ -90,6 +95,7 @@ char *committer_email;

unsigned long committer_date; char *subject; char *msg; + char *msg_encoding; }; struct taginfo {
M parsing.cparsing.c

@@ -199,6 +199,7 @@ ret->committer = NULL;

ret->committer_email = NULL; ret->subject = NULL; ret->msg = NULL; + ret->msg_encoding = NULL; if (p == NULL) return ret;
M shared.cshared.c

@@ -265,6 +265,8 @@ free(info->author_email);

free(info->committer); free(info->committer_email); free(info->subject); + free(info->msg); + free(info->msg_encoding); free(info); return NULL; }
M ui-shared.cui-shared.c

@@ -352,7 +352,7 @@ }

void cgit_print_docstart(char *title, struct cacheitem *item) { - html("Content-Type: text/html; charset=utf-8\n"); + html("Content-Type: text/html; charset=" PAGE_ENCODING "\n"); htmlf("Last-Modified: %s\n", http_date(item->st.st_mtime)); htmlf("Expires: %s\n", http_date(item->st.st_mtime + ttl_seconds(item->ttl)));