mothra: fix file urls with #fragment
This commit is contained in:
parent
92f22e7b5a
commit
145d0b3982
1 changed files with 7 additions and 2 deletions
|
@ -729,9 +729,14 @@ int fileurlopen(Url *url){
|
||||||
*x = 0;
|
*x = 0;
|
||||||
snprint(url->fullname, sizeof(url->fullname), "%s/%s", base, rel);
|
snprint(url->fullname, sizeof(url->fullname), "%s/%s", base, rel);
|
||||||
if(x) *x = '/';
|
if(x) *x = '/';
|
||||||
fd = open(cleanname(url->fullname), OREAD);
|
|
||||||
}else
|
}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)
|
if(fd < 0)
|
||||||
return -1;
|
return -1;
|
||||||
memset(url->fullname, 0, sizeof(url->fullname));
|
memset(url->fullname, 0, sizeof(url->fullname));
|
||||||
|
|
Loading…
Reference in a new issue