summary refs log tree commit diff
path: root/nav.c
diff options
context:
space:
mode:
authorwrmr2024-11-03 12:49:38 -0500
committerwrmr2024-11-03 12:49:38 -0500
commit9faead33740e7b5b847478518fd3a270a2aa5c2a (patch)
treedcf3b0e397bcec261341c598a20621c52b13ef87 /nav.c
parentce088cbf9c3a73e9f9ed3012d31dd6e989d86052 (diff)
some refactoring to disconnect doc_type from networking
Diffstat (limited to 'nav.c')
-rw-r--r--nav.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nav.c b/nav.c
index 59fdca6..8f1d699 100644
--- a/nav.c
+++ b/nav.c
@@ -98,17 +98,18 @@ void nav_redraw(struct nav_state *ns) {
 /* network */
 
 int nav_to(struct nav_state *ns, const char *url) {
+	enum doc_type doct;
 	struct addr adr;
 	buf_t buf;
 	if (net_addr(url, &adr, ns->prot_default)) {
 		return -1;
 	}
 	ns->prot_default = adr.prot;
-	if (net_fetch(&adr, &buf)) {
+	if (net_fetch(&adr, &buf, &doct)) {
 		return -1;
 	}
 	struct doc d;
-	if (parse_doc(adr.type, &d, &buf)) {
+	if (parse_doc(doct, &d, &buf)) {
 		buf_free(&buf);
 		return -1;
 	}