X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/5c5d189635287a3bfaa1a4aef133dc0c582a27c2..f8f6e1fe789e9dbcea40a0f8d5ebfb019c2a1a19:/ui-tree.c diff --git a/ui-tree.c b/ui-tree.c index 75ec9cb..2d8d2f3 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -45,9 +45,11 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) if (ctx.repo->source_filter) { html("
");
 		ctx.repo->source_filter->argv[1] = xstrdup(name);
-		cgit_open_filter(ctx.repo->source_filter);
-		write(STDOUT_FILENO, buf, size);
+		cgit_open_filter(ctx.repo->source_filter, ctx.repo);
+		html_raw(buf, size);
 		cgit_close_filter(ctx.repo->source_filter);
+		free(ctx.repo->source_filter->argv[1]);
+		ctx.repo->source_filter->argv[1] = NULL;
 		html("
\n"); return; } @@ -67,7 +69,7 @@ static void print_binary_buffer(char *buf, unsigned long size) html("\n"); html(""); for (ofs = 0; ofs < size; ofs += ROWLEN, buf += ROWLEN) { - htmlf("
ofshex dumpascii
%04x", ofs); + htmlf("
%04lx", ofs); for (idx = 0; idx < ROWLEN && ofs + idx < size; idx++) htmlf("%*s%02x", idx == 16 ? 4 : 1, "", @@ -108,7 +110,7 @@ static void print_object(const unsigned char *sha1, char *path, const char *base html(")\n"); if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) { - htmlf("
blob size (%dKB) exceeds display size limit (%dKB).
", + htmlf("
blob size (%ldKB) exceeds display size limit (%dKB).
", size / 1024, ctx.cfg.max_blob_size); return; }