From b6ffc623fec1149c2be40ce94e160b2a5c542bf4 Mon Sep 17 00:00:00 2001 From: Samuel Lidén Borell Date: Sat, 7 Jan 2023 10:32:07 +0100 Subject: config: make empty js= omit script tag According to the cgitrc man page, an empty js= value should cause the script tag to be omitted. But instead, a script tag with an empty URL is emitted. The same applies to css. So, skip emitting a tag if the specified string is empty. Signed-off-by: Samuel Lidén Borell Signed-off-by: Jason A. Donenfeld --- ui-shared.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui-shared.c b/ui-shared.c index 959ed8b..25bd3f4 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -770,6 +770,10 @@ static void print_rel_vcs_link(const char *url) static int emit_css_link(struct string_list_item *s, void *arg) { + /* Do not emit anything if css= is specified. */ + if (s && *s->string == '\0') + return 0; + html("