From d8a045c91469b1d121b8fd14dffaa367b194831d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 6 Sep 2026 21:46:52 -1000 Subject: Clean up the whole tree --- source/ui-plain.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'source/ui-plain.c') diff --git a/source/ui-plain.c b/source/ui-plain.c index d3b4771..6b45637 100644 --- a/source/ui-plain.c +++ b/source/ui-plain.c @@ -62,10 +62,8 @@ static void print_object(const struct object_id *oid, const char *path) // The limit counts kilobytes and is checked before the read, so a huge // blob is kept out of memory rather than noticed once it is there. - if (ctx.cfg.max_blob_size && - size / 1024 > (unsigned long)ctx.cfg.max_blob_size) { - cgit_print_error_page(413, "Content Too Large", - "Object size (%luKB) exceeds limit (%dKB)", + if (ctx.cfg.max_blob_size && size / 1024 > (unsigned long)ctx.cfg.max_blob_size) { + cgit_print_error_page(413, "Content Too Large", "Object size (%luKB) exceeds limit (%dKB)", size / 1024, ctx.cfg.max_blob_size); return; } @@ -142,15 +140,14 @@ static void print_dir(const char *base, int baselen, const char *path) fullpath = NULL; } html("
  • "); - cgit_plain_link("../", NULL, NULL, ctx.qry.head, ctx.qry.oid, - fullpath); + cgit_plain_link("../", NULL, NULL, ctx.qry.head, ctx.qry.oid, fullpath); html("
  • \n"); } free(fullpath); } static void print_dir_entry(const struct object_id *oid, const char *base, - int baselen, const char *path, unsigned mode) + int baselen, const char *path, unsigned mode) { char *fullpath; @@ -161,8 +158,7 @@ static void print_dir_entry(const struct object_id *oid, const char *base, if (S_ISGITLINK(mode)) cgit_submodule_link(NULL, fullpath, oid_to_hex(oid)); else - cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.oid, - fullpath); + cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.oid, fullpath); html("\n"); free(fullpath); } @@ -177,7 +173,7 @@ static void print_dir_tail(void) * READ_TREE_RECURSIVE means step into this entry and zero means step over it. */ static int walk_tree(const struct object_id *oid, struct strbuf *base, - const char *pathname, unsigned mode, void *context) + const char *pathname, unsigned mode, void *context) { struct walk_tree_context *walk = context; @@ -252,8 +248,7 @@ void cgit_print_plain(void) } else { walk.dir_len = dir_prefix_len(path_items.match); } - read_tree(the_repository, repo_get_commit_tree(the_repository, commit), - &paths, walk_tree, &walk); + read_tree(the_repository, repo_get_commit_tree(the_repository, commit), &paths, walk_tree, &walk); if (walk.response == RESPONSE_NONE) cgit_print_error_page(404, "Not Found", "Not found"); else if (walk.response == RESPONSE_LISTING) -- cgit v2.8.0