diff options
| author | Christian Barcenas <christian@cbarcenas.com> | 2025-08-21 14:46:33 -0500 |
|---|---|---|
| committer | Christian Hesse <mail@eworm.de> | 2025-11-17 21:40:58 +0100 |
| commit | 5b7c622cbf56391b7dd95d5a5bd84dde3f5878e5 (patch) | |
| tree | d3ac06096c5caa5715a8cb8a07865ca7117f5d60 /ui-shared.c | |
| parent | 23f5bc92b39885a2dc329cd7d9ea86b53a8014ee (diff) | |
| download | cgit-5b7c622cbf56391b7dd95d5a5bd84dde3f5878e5.tar.gz cgit-5b7c622cbf56391b7dd95d5a5bd84dde3f5878e5.tar.bz2 cgit-5b7c622cbf56391b7dd95d5a5bd84dde3f5878e5.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>
Diffstat (limited to 'ui-shared.c')
| -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"); |
