@@ 616,8 616,8 @@ texthit(Panel *p, int b, Rtext *rt)
/* no slash, must be a hostname */
n = smprint("gemini://%s", current_base_url->host);
}else if(*link == '/'){
- /* start with a slash so skip it (+1) */
- n = smprint("%s%s", urlparse(current_base_url, link)->raw, estrdup(link)+1);
+ /* start with a slash so use the base host */
+ n = smprint("gemini://%s%s", current_base_url->host, estrdup(link));
}else{
/* make an absolute URL of the link */
n = smprint("%s%s", urlparse(current_base_url, link)->raw, estrdup(link));
@@ 223,7 223,10 @@ mklowcase(char *s)
static Url *
saneurl(Url *u)
{
- if(u == nil || u->scheme == nil || Upath(u) == nil){
+ if(strcmp(u->scheme, "mailto") == 0 && Upath(u) != nil)
+ return u;
+
+ if(u == nil || u->scheme == nil || u->host == nil || Upath(u) == nil){
freeurl(u);
return nil;
}