On Tue, Jul 19, 2011 at 10:51:58AM +0200, Ferry Huberts wrote:
> From: Ferry Huberts <[email protected]>
> 
> For sites that do not want to configure mime types by hand but
> still want the correct mime type for 'plain' blobs, configuring
> a mime type file is made possible. This is handy since such a
> file is normally already provided (at least on Linux systems).
> 
> Also, this reflects the gitweb option '$mimetypes_file'
> 
> Signed-off-by: Ferry Huberts <[email protected]>

Thanks. I've merged this to my wip branch with the following fixup to
avoid random free()'s:

diff --git a/ui-plain.c b/ui-plain.c
index 50476f4..7fecc32 100644
--- a/ui-plain.c
+++ b/ui-plain.c
@@ -75,8 +75,8 @@ static void print_object(const unsigned char *sha1, const 
char *path)
        }
        ctx.page.mimetype = NULL;
        ext = strrchr(path, '.');
+       freemime = 0;
        if (ext && *(++ext)) {
-               freemime = 0;
                mime = string_list_lookup(&ctx.cfg.mimetypes, ext);
                if (mime) {
                        ctx.page.mimetype = (char *)mime->util;

--
larsh

_______________________________________________
cgit mailing list
[email protected]
http://hjemli.net/mailman/listinfo/cgit

Reply via email to