summaryrefslogtreecommitdiff
path: root/sys/src
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@centraldogma>2011-09-17 05:21:49 +0200
committercinap_lenrek <cinap_lenrek@centraldogma>2011-09-17 05:21:49 +0200
commit145d0b3982f80b4630feb5229216e4fe81de2ddb (patch)
tree1d98979f53856af641cbc6c04500b5939da78c7a /sys/src
parent92f22e7b5a6e2050de93ab11ecd2320b72eb9721 (diff)
mothra: fix file urls with #fragment
Diffstat (limited to 'sys/src')
-rw-r--r--sys/src/cmd/mothra/mothra.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/src/cmd/mothra/mothra.c b/sys/src/cmd/mothra/mothra.c
index ef51ee2d0..18712238b 100644
--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -729,9 +729,14 @@ int fileurlopen(Url *url){
*x = 0;
snprint(url->fullname, sizeof(url->fullname), "%s/%s", base, rel);
if(x) *x = '/';
- fd = open(cleanname(url->fullname), OREAD);
}else
- fd = open(rel, OREAD);
+ snprint(url->fullname, sizeof(url->fullname), "%s", rel);
+ url->tag[0] = 0;
+ if(x = strrchr(url->fullname, '#')){
+ *x++ = 0;
+ strncpy(url->tag, x, sizeof(url->tag));
+ }
+ fd = open(cleanname(url->fullname), OREAD);
if(fd < 0)
return -1;
memset(url->fullname, 0, sizeof(url->fullname));