diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-01 11:20:28 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-01 11:20:28 +0200 |
commit | 815c2ba22ba5d15cdedd39837d4edb4107eb0b32 (patch) | |
tree | 0e99112e36451d449534ed85a99710a43e9e3ff6 /sys/src/cmd/mothra/forms.c | |
parent | f62a2efb7add3ec40ca91adc514d5bdb6b0cd721 (diff) |
mothra: support for inline images and <image> tag
Diffstat (limited to 'sys/src/cmd/mothra/forms.c')
-rw-r--r-- | sys/src/cmd/mothra/forms.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/src/cmd/mothra/forms.c b/sys/src/cmd/mothra/forms.c index 90cfe4683..3c8a8fd48 100644 --- a/sys/src/cmd/mothra/forms.c +++ b/sys/src/cmd/mothra/forms.c @@ -129,7 +129,7 @@ void rdform(Hglob *g){ form->method = 0; form->fields = 0; form->efields = 0; - if(g->state->link[0]) + if(g->state->link) form->action = strdup(g->state->link); form->next = g->dst->form; g->dst->form = form; @@ -172,8 +172,10 @@ void rdform(Hglob *g){ else if(cistrcmp(s, "image")==0){ f->type=SUBMIT; s=pl_getattr(g->attr, "src"); - if(s && *s) - nstrcpy(g->state->image, s, sizeof(g->state->image)); + if(s && *s){ + free(g->state->image); + g->state->image = strdup(s); + } s=pl_getattr(g->attr, "width"); if(s && *s) g->state->width=strtolength(g, HORIZ, s); |