diff options
| author | Christian Barcenas <christian@cbarcenas.com> | 2025-08-21 14:46:33 -0500 |
|---|---|---|
| committer | Christian Hesse <mail@eworm.de> | 2025-08-25 10:52:36 +0200 |
| commit | 83f6542f2073e28555d2a19d08ef58fabfc231ea (patch) | |
| tree | c8283a232da13a266a90bd64411a887e64ec0be8 | |
| parent | 28404bef7eb29eeda71ec642218e961bbf57763a (diff) | |
| download | cgit-83f6542f2073e28555d2a19d08ef58fabfc231ea.tar.gz cgit-83f6542f2073e28555d2a19d08ef58fabfc231ea.tar.bz2 cgit-83f6542f2073e28555d2a19d08ef58fabfc231ea.tar.xz | |
ui-shared: don't write <link> if favicon unset
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@cbarcenas.com>
Signed-off-by: Christian Hesse <mail@eworm.de>
| -rw-r--r-- | ui-shared.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c index aa95b87..bb9d817 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -838,7 +838,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"); |
