if the <input type="submit|reset"> has no value, use a default one - webdump - HTML to plain-text converter for webpages
(HTM) git clone git://git.codemadness.org/webdump
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit bf60f514843dfa9c2cc5d10fa9e7f3978da5cefb
(DIR) parent 29ab23324d260dae10475498bfcabd06a4c9ba48
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 13 Sep 2023 20:39:42 +0200
if the <input type="submit|reset"> has no value, use a default one
Diffstat:
M webdump.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/webdump.c b/webdump.c
@@ -2061,10 +2061,12 @@ xmltagstartparsed(XMLParser *p, const char *t, size_t tl, int isshort)
} else if (cur->tag.displaytype & DisplayInput) {
if (!attr_type.len) {
hprintf("[%-15s]", attr_value.len ? attr_value.data : ""); /* default: text */
- } else if (!strcasecmp(attr_type.data, "button") ||
- !strcasecmp(attr_type.data, "submit") ||
- !strcasecmp(attr_type.data, "reset")) {
+ } else if (!strcasecmp(attr_type.data, "button")) {
hprintf("[%s]", attr_value.len ? attr_value.data : "");
+ } else if (!strcasecmp(attr_type.data, "submit")) {
+ hprintf("[%s]", attr_value.len ? attr_value.data : "Submit Query");
+ } else if (!strcasecmp(attr_type.data, "reset")) {
+ hprintf("[%s]", attr_value.len ? attr_value.data : "Reset");
} else if (!strcasecmp(attr_type.data, "checkbox")) {
hprintf("[%s]",
attr_checked.len &&