about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ui-plain.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ui-plain.c b/ui-plain.c index 9c86542..c9ec403 100644 --- a/ui-plain.c +++ b/ui-plain.c
@@ -83,17 +83,22 @@ static int print_object(const unsigned char *sha1, const char *path)
83 mime = string_list_lookup(&ctx.cfg.mimetypes, ext); 83 mime = string_list_lookup(&ctx.cfg.mimetypes, ext);
84 if (mime) { 84 if (mime) {
85 ctx.page.mimetype = (char *)mime->util; 85 ctx.page.mimetype = (char *)mime->util;
86 ctx.page.charset = NULL;
86 } else { 87 } else {
87 ctx.page.mimetype = get_mimetype_from_file(ctx.cfg.mimetype_file, ext); 88 ctx.page.mimetype = get_mimetype_from_file(ctx.cfg.mimetype_file, ext);
88 if (ctx.page.mimetype) 89 if (ctx.page.mimetype) {
89 freemime = 1; 90 freemime = 1;
91 ctx.page.charset = NULL;
92 }
90 } 93 }
91 } 94 }
92 if (!ctx.page.mimetype) { 95 if (!ctx.page.mimetype) {
93 if (buffer_is_binary(buf, size)) 96 if (buffer_is_binary(buf, size)) {
94 ctx.page.mimetype = "application/octet-stream"; 97 ctx.page.mimetype = "application/octet-stream";
95 else 98 ctx.page.charset = NULL;
99 } else {
96 ctx.page.mimetype = "text/plain"; 100 ctx.page.mimetype = "text/plain";
101 }
97 } 102 }
98 ctx.page.filename = path; 103 ctx.page.filename = path;
99 ctx.page.size = size; 104 ctx.page.size = size;