[PATCH] ui-shared: don't write <link> if favicon unset
Christian Barcenas
christian at cbarcenas.com
Thu Aug 21 19:46:33 UTC 2025
Since the favicon setting defaults to "/favicon.ico", the user can
only unset it with favicon=. However, that would write an empty string
as the config value. Previously, such empty string always satisfied
the if condition. In this case it is better to omit the <link> entirely.
Signed-off-by: Christian Barcenas <christian at cbarcenas.com>
diff --git a/ui-shared.c b/ui-shared.c
index 6fae72d..3c33600 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -832,7 +832,7 @@ void cgit_print_docstart(void)
else
emit_js_link(NULL, "/cgit.js");
- if (ctx.cfg.favicon) {
+ if (ctx.cfg.favicon && *ctx.cfg.favicon) {
html("<link rel='shortcut icon' href='");
html_attr(ctx.cfg.favicon);
html("'/>\n");
More information about the CGit
mailing list