summaryrefslogtreecommitdiff
path: root/sys/src/cmd/mothra/rdhtml.c
diff options
context:
space:
mode:
authorstanley lieber <stanley.lieber@gmail.com>2011-10-01 21:30:12 -0500
committerstanley lieber <stanley.lieber@gmail.com>2011-10-01 21:30:12 -0500
commit2036c493940eea8cd9d67fe792713d38b81547af (patch)
treee0543f6be7a813523c1c42beba647341096f41c3 /sys/src/cmd/mothra/rdhtml.c
parent931dd8bbe81f10047a85ef73298f0548490753fd (diff)
mothra: add moth mode; display images that are not also links as a link to themselves
Diffstat (limited to 'sys/src/cmd/mothra/rdhtml.c')
-rw-r--r--sys/src/cmd/mothra/rdhtml.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/src/cmd/mothra/rdhtml.c b/sys/src/cmd/mothra/rdhtml.c
index 44ba88c82..33ac45b7c 100644
--- a/sys/src/cmd/mothra/rdhtml.c
+++ b/sys/src/cmd/mothra/rdhtml.c
@@ -639,8 +639,11 @@ void plrdhtml(char *name, int fd, Www *dst){
case Tag_meta:
break;
case Tag_img:
- if(str=pl_getattr(g.attr, "src"))
+ if(str=pl_getattr(g.attr, "src")){
strncpy(g.state->image, str, sizeof(g.state->image));
+ if(g.state->link[0]==0)
+ strncpy(g.state->link, str, sizeof(g.state->link));
+ }
g.state->ismap=pl_hasattr(g.attr, "ismap");
if(str=pl_getattr(g.attr, "width"))
g.state->width = strtolength(&g, HORIZ, str);