~julienxx/castor9

1e9ebfb3aec50a18bfaec8da2a96b9604e40ca18 — Julien Blanchard 3 years ago 897c123
Fix absolute URLs parsing and mailto
1 files changed, 3 insertions(+), 1 deletions(-)

M castor.c
M castor.c => castor.c +3 -1
@@ 606,6 606,8 @@ texthit(Panel *p, int b, Rtext *rt)
		next_url = urlparse(nil, link);
	}else if(strbeg(link, "//") == 0){
		next_url = urlparse(nil, smprint("gemini:%s", link));
	}else if(strbeg(link, "mailto:") == 0){
		next_url = urlparse(nil, link);
	}else{
		/* assuming relative URL */
		if(strcmp(link, "/") == 0){


@@ 613,7 615,7 @@ texthit(Panel *p, int b, Rtext *rt)
		}else if(*link == '/'){
			n = smprint("%s%s", urlparse(current_base_url, link)->raw, estrdup(link)+1);
		}else{
			n = estrdup(link);
			n = smprint("%s%s", urlparse(current_base_url, link)->raw, estrdup(link));
		}
		next_url = urlparse(nil, n);
	}