diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/html.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/utils/html.c b/src/utils/html.c index 7c105d0..68af9a6 100644 --- a/src/utils/html.c +++ b/src/utils/html.c @@ -624,10 +624,19 @@ mq_html_form(const gchar *submit_label, const gchar *reset_label, ...) gchar * mq_html_input_text(const gchar *name, const gchar *label, const gchar *value) { - return g_strdup_printf("<label for=\"%s\">\n<span>%s:</span>\n" - "<input type=\"text\" name=\"%s\" id=\"%s\" value=\"%s\">\n" - "</label>\n", - name, label, name, name, value ? value : ""); + if (label && label[0]) { + return g_strdup_printf( + "<label for=\"%s\">\n<span>%s:</span>\n" + "<input type=\"text\" name=\"%s\" id=\"%s\" " + "value=\"%s\">\n" + "</label>\n", + name, label, name, name, value ? value : ""); + } else { + return g_strdup_printf( + "<input type=\"text\" name=\"%s\" id=\"%s\" " + "value=\"%s\">\n", + name, name, value ? value : ""); + } } gchar * |