summaryrefslogtreecommitdiff
path: root/sys/src/cmd/mothra/rdhtml.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-07-17 07:21:22 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-07-17 07:21:22 +0200
commita78f5f8a3d72fc18c9bb734e066f45e9a3be5ab0 (patch)
treeb1259e1089a2287f5e35d7c52f2ff3365bb6ba3c /sys/src/cmd/mothra/rdhtml.c
parent05c11fefe0c633ab061b9f69180593ed9cf073a2 (diff)
mothra: handle relative urls in <base> tag
Diffstat (limited to 'sys/src/cmd/mothra/rdhtml.c')
-rw-r--r--sys/src/cmd/mothra/rdhtml.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/src/cmd/mothra/rdhtml.c b/sys/src/cmd/mothra/rdhtml.c
index be8378dbd..201959762 100644
--- a/sys/src/cmd/mothra/rdhtml.c
+++ b/sys/src/cmd/mothra/rdhtml.c
@@ -734,8 +734,12 @@ void plrdhtml(char *name, int fd, Www *dst){
g.spacc++;
break;
case Tag_base:
- if(str=pl_getattr(g.attr, "href"))
+ if(str=pl_getattr(g.attr, "href")){
+ seturl(g.dst->url, str, g.dst->url->fullname);
nstrcpy(g.dst->url->fullname, str, sizeof(g.dst->url->fullname));
+ /* base should be a full url, but it often isnt so have to resolve */
+ urlresolve(g.dst->url);
+ }
break;
case Tag_a:
if(str=pl_getattr(g.attr, "name"))