From cb731e707285f5dd7289bd4e29fdc2e65c0279fa Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 31 Dec 2025 12:53:05 +0100 Subject: fix readme selection --- ui-summary.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui-summary.c b/ui-summary.c index 00a5dd5..57182e3 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -162,6 +162,7 @@ static int get_readme_oid_cb(const struct object_id *oid, struct strbuf *base, struct get_readme_oid_ctx *ctx = (struct get_readme_oid_ctx*)cbdata; // TODO: make readme.md configurable + const size_t readme_names_count = 2; const char **readme_names = (const char*[]){"readme.md", "readme"}; struct strbuf buffer = STRBUF_INIT; @@ -184,7 +185,7 @@ static int get_readme_oid_cb(const struct object_id *oid, struct strbuf *base, strbuf_release(&buffer); - for (int i = 0; i < sizeof(readme_names)/sizeof(*readme_names); i++) { + for (int i = 0; i < readme_names_count; i++) { if (match_base && strcasecmp(pathname, readme_names[i]) == 0) { *(ctx->oid) = *oid; *(ctx->filename) = xstrdup(pathname); -- cgit v1.2.3