mothra: fix file urls with #fragment
parent
92f22e7b5a
commit
145d0b3982
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue