all repos — cgit @ 568d8d3fd3f5a3b4207887215c8adcbac2bb9552

a hyperfast web frontend for git written in c

Merge branch 'stable'
Lars Hjemli hjemli@gmail.com
Sat, 26 Mar 2011 15:22:35 +0100
commit

568d8d3fd3f5a3b4207887215c8adcbac2bb9552

parent

2e6721edbb3c94a70f4ef0ead5e55b9da19fb806

2 files changed, 18 insertions(+), 11 deletions(-)

jump to
M cgitrc.5.txtcgitrc.5.txt

@@ -287,8 +287,9 @@ A path which will be scanned for repositories. If caching is enabled,

the result will be cached as a cgitrc include-file in the cache directory. If project-list has been defined prior to scan-path, scan-path loads only the directories listed in the file pointed to by - project-list. Default value: none. See also: cache-scanrc-ttl, - project-list. + project-list. Be advised that only the global settings taken + before the scan-path directive will be applied to each repository. + Default value: none. See also: cache-scanrc-ttl, project-list. section:: The name of the current repository section - all repositories defined
M parsing.cparsing.c

@@ -106,7 +106,11 @@

if (!txt || !*txt || !src_enc || !dst_enc) return *txt; - tmp = reencode_string(*txt, src_enc, dst_enc); + /* no encoding needed if src_enc equals dst_enc */ + if(!strcasecmp(src_enc, dst_enc)) + return *txt; + + tmp = reencode_string(*txt, dst_enc, src_enc); if (tmp) { free(*txt); *txt = tmp;

@@ -160,6 +164,10 @@ p = t + 1;

} } + /* if no special encoding is found, assume UTF-8 */ + if(!ret->msg_encoding) + ret->msg_encoding = xstrdup("UTF-8"); + // skip unknown header fields while (p && *p && (*p != '\n')) { p = strchr(p, '\n');

@@ -189,14 +197,12 @@ ret->msg = xstrdup(p);

} else ret->subject = xstrdup(p); - if (ret->msg_encoding) { - reencode(&ret->author, PAGE_ENCODING, ret->msg_encoding); - reencode(&ret->author_email, PAGE_ENCODING, ret->msg_encoding); - reencode(&ret->committer, PAGE_ENCODING, ret->msg_encoding); - reencode(&ret->committer_email, PAGE_ENCODING, ret->msg_encoding); - reencode(&ret->subject, PAGE_ENCODING, ret->msg_encoding); - reencode(&ret->msg, PAGE_ENCODING, ret->msg_encoding); - } + reencode(&ret->author, ret->msg_encoding, PAGE_ENCODING); + reencode(&ret->author_email, ret->msg_encoding, PAGE_ENCODING); + reencode(&ret->committer, ret->msg_encoding, PAGE_ENCODING); + reencode(&ret->committer_email, ret->msg_encoding, PAGE_ENCODING); + reencode(&ret->subject, ret->msg_encoding, PAGE_ENCODING); + reencode(&ret->msg, ret->msg_encoding, PAGE_ENCODING); return ret; }