diff --git a/src/cache/cache.c b/src/cache/cache.c index d50a310b..94e84825 100644 --- a/src/cache/cache.c +++ b/src/cache/cache.c @@ -760,7 +760,7 @@ redirect_cache(struct cache_entry *cached, char *location, } if (cached->redirect) done_uri(cached->redirect); - cached->redirect = get_uri(uristring, 0); + cached->redirect = get_uri(uristring, URI_NONE); cached->redirect_get = get; if (incomplete >= 0) cached->incomplete = incomplete; diff --git a/src/dialogs/menu.c b/src/dialogs/menu.c index 19211c22..90937d2b 100644 --- a/src/dialogs/menu.c +++ b/src/dialogs/menu.c @@ -54,7 +54,7 @@ menu_url_shortcut(struct terminal *term, void *url_, void *ses_) { char *url = url_; struct session *ses = ses_; - struct uri *uri = get_uri(url, 0); + struct uri *uri = get_uri(url, URI_NONE); if (!uri) return; goto_uri(ses, uri); diff --git a/src/document/dom/source.c b/src/document/dom/source.c index 9baf0e6b..6e247239 100644 --- a/src/document/dom/source.c +++ b/src/document/dom/source.c @@ -219,7 +219,7 @@ set_base_uri(struct dom_renderer *renderer, char *value, size_t valuelen) mem_free(href); if (!uristring) return; - uri = get_uri(uristring, 0); + uri = get_uri(uristring, URI_NONE); mem_free(uristring); if (!uri) return; diff --git a/src/document/html/frames.c b/src/document/html/frames.c index 15deafeb..415bbd3f 100644 --- a/src/document/html/frames.c +++ b/src/document/html/frames.c @@ -49,9 +49,9 @@ add_frameset_entry(struct frameset_desc *frameset_desc, frame_desc = &frameset_desc->frame_desc[offset]; frame_desc->subframe = subframe; frame_desc->name = null_or_stracpy(name); - frame_desc->uri = (url && *url) ? get_uri(url, 0) : NULL; + frame_desc->uri = (url && *url) ? get_uri(url, URI_NONE) : NULL; if (!frame_desc->uri) - frame_desc->uri = get_uri("about:blank", 0); + frame_desc->uri = get_uri("about:blank", URI_NONE); frameset_desc->box.x++; if (frameset_desc->box.x >= frameset_desc->box.width) { diff --git a/src/document/html/iframes.c b/src/document/html/iframes.c index 664a0ed0..dc8c2f20 100644 --- a/src/document/html/iframes.c +++ b/src/document/html/iframes.c @@ -47,13 +47,13 @@ void add_iframeset_entry(struct iframeset_desc **parent, offset = iframeset_desc->n; iframe_desc = &iframeset_desc->iframe_desc[offset]; iframe_desc->name = stracpy(name); - iframe_desc->uri = get_uri(url, 0); + iframe_desc->uri = get_uri(url, URI_NONE); iframe_desc->x = 1; iframe_desc->y = y; iframe_desc->width = width; iframe_desc->height = height; if (!iframe_desc->uri) - iframe_desc->uri = get_uri("about:blank", 0); + iframe_desc->uri = get_uri("about:blank", URI_NONE); iframeset_desc->n++; } diff --git a/src/document/html/parser/general.c b/src/document/html/parser/general.c index 929dbd01..ebf6aa1d 100644 --- a/src/document/html/parser/general.c +++ b/src/document/html/parser/general.c @@ -735,7 +735,7 @@ html_base(struct html_context *html_context, char *a, al = get_url_val(a, "href", html_context->doc_cp); if (al) { char *base = join_urls(html_context->base_href, al); - struct uri *uri = base ? get_uri(base, 0) : NULL; + struct uri *uri = base ? get_uri(base, URI_NONE) : NULL; mem_free(al); mem_free_if(base); diff --git a/src/document/refresh.c b/src/document/refresh.c index 38cb68eb..d5eaff8f 100644 --- a/src/document/refresh.c +++ b/src/document/refresh.c @@ -34,7 +34,7 @@ init_document_refresh(char *url, unsigned long seconds) refresh = mem_alloc(sizeof(*refresh)); if (!refresh) return NULL; - refresh->uri = get_uri(url, 0); + refresh->uri = get_uri(url, URI_NONE); if (!refresh->uri) { mem_free(refresh); return NULL; diff --git a/src/document/xml/tags.c b/src/document/xml/tags.c index f9673a4d..0e6b9c49 100644 --- a/src/document/xml/tags.c +++ b/src/document/xml/tags.c @@ -569,7 +569,7 @@ tags_html_base(struct source_renderer *renderer, void *no, unsigned char *a, if (al) { unsigned char *base = join_urls(html_context->base_href, al); - struct uri *uri = base ? get_uri(base, 0) : NULL; + struct uri *uri = base ? get_uri(base, URI_NONE) : NULL; mem_free(al); mem_free_if(base); diff --git a/src/ecmascript/ecmascript.c b/src/ecmascript/ecmascript.c index 88303787..d768db40 100644 --- a/src/ecmascript/ecmascript.c +++ b/src/ecmascript/ecmascript.c @@ -486,7 +486,7 @@ ecmascript_protocol_handler(struct session *ses, struct uri *uri) mem_free(redirect_url); if (!redirect_abs_url) return; - redirect_uri = get_uri(redirect_abs_url, 0); + redirect_uri = get_uri(redirect_abs_url, URI_NONE); mem_free(redirect_abs_url); if (!redirect_uri) return; @@ -764,7 +764,7 @@ location_goto(struct document_view *doc_view, char *url) trim_chars(url, ' ', 0)); if (!new_abs_url) return; - new_uri = get_uri(new_abs_url, 0); + new_uri = get_uri(new_abs_url, URI_NONE); mem_free(new_abs_url); if (!new_uri) return; diff --git a/src/ecmascript/quickjs/window.c b/src/ecmascript/quickjs/window.c index 642f5b55..27026a9d 100644 --- a/src/ecmascript/quickjs/window.c +++ b/src/ecmascript/quickjs/window.c @@ -143,7 +143,7 @@ js_window_open(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *ar /* TODO: Support for window naming and perhaps some window features? */ - uri = get_uri(url2, 0); + uri = get_uri(url2, URI_NONE); mem_free(url2); if (!uri) { if (frame) JS_FreeCString(ctx, frame); diff --git a/src/ecmascript/spidermonkey/window.c b/src/ecmascript/spidermonkey/window.c index 2a8fa84a..5829df6d 100644 --- a/src/ecmascript/spidermonkey/window.c +++ b/src/ecmascript/spidermonkey/window.c @@ -359,7 +359,7 @@ window_open(JSContext *ctx, unsigned int argc, JS::Value *rval) /* TODO: Support for window naming and perhaps some window features? */ - uri = get_uri(url2, 0); + uri = get_uri(url2, URI_NONE); mem_free(url2); if (!uri) { mem_free_if(frame); diff --git a/src/formhist/dialogs.c b/src/formhist/dialogs.c index 7b05f7f1..b6acc899 100644 --- a/src/formhist/dialogs.c +++ b/src/formhist/dialogs.c @@ -90,7 +90,7 @@ get_formhist_data_uri(struct listbox_item *item) { struct formhist_data *formhist_data = item->udata; - return get_uri(formhist_data->url, 0); + return get_uri(formhist_data->url, URI_NONE); } static struct listbox_item * diff --git a/src/globhist/dialogs.c b/src/globhist/dialogs.c index aba0949d..7f7571d2 100644 --- a/src/globhist/dialogs.c +++ b/src/globhist/dialogs.c @@ -84,7 +84,7 @@ get_globhist_item_uri(struct listbox_item *item) { struct global_history_item *historyitem = item->udata; - return get_uri(historyitem->url, 0); + return get_uri(historyitem->url, URI_NONE); } static int diff --git a/src/protocol/bittorrent/bencoding.c b/src/protocol/bittorrent/bencoding.c index 3bddba6e..8bcaea76 100644 --- a/src/protocol/bittorrent/bencoding.c +++ b/src/protocol/bittorrent/bencoding.c @@ -725,7 +725,7 @@ parse_bittorrent_metafile(struct bittorrent_meta *meta, if (!value_string) break; - uri = get_uri(value_string, 0); + uri = get_uri(value_string, URI_NONE); mem_free(value_string); if (uri) { add_to_uri_list(&meta->tracker_uris, uri); diff --git a/src/protocol/bittorrent/connection.c b/src/protocol/bittorrent/connection.c index 999ee7b1..42b3a0df 100644 --- a/src/protocol/bittorrent/connection.c +++ b/src/protocol/bittorrent/connection.c @@ -407,7 +407,7 @@ bittorrent_protocol_handler(struct connection *conn) } if (conn->uri->datalen) - uri = get_uri(conn->uri->data, 0); + uri = get_uri(conn->uri->data, URI_NONE); if (!uri) { abort_connection(conn, connection_state(S_BITTORRENT_BAD_URL)); diff --git a/src/protocol/bittorrent/dialogs.c b/src/protocol/bittorrent/dialogs.c index c8663b97..ee1460f7 100644 --- a/src/protocol/bittorrent/dialogs.c +++ b/src/protocol/bittorrent/dialogs.c @@ -644,7 +644,7 @@ bittorrent_download(struct dialog_data *dlg_data, struct widget_data *widget_dat add_to_string(&redirect, "bittorrent:"); add_uri_to_string(&redirect, type_query->uri, URI_ORIGINAL); - uri = get_uri(redirect.source, 0); + uri = get_uri(redirect.source, URI_NONE); done_string(&redirect); tp_cancel(type_query); diff --git a/src/protocol/bittorrent/peerconnect.c b/src/protocol/bittorrent/peerconnect.c index 90da468b..ff34616f 100644 --- a/src/protocol/bittorrent/peerconnect.c +++ b/src/protocol/bittorrent/peerconnect.c @@ -302,7 +302,7 @@ make_bittorrent_peer_connection(struct bittorrent_connection *bittorrent, "bittorrent-peer://%s:%u/", peer_info->ip, (unsigned) peer_info->port)) goto out; - uri = get_uri(uri_string.source, 0); + uri = get_uri(uri_string.source, URI_NONE); if (!uri) goto out; make_connection(peer->socket, uri, send_bittorrent_peer_handshake, 1); diff --git a/src/protocol/bittorrent/tracker.c b/src/protocol/bittorrent/tracker.c index c3284a91..0d9e882c 100644 --- a/src/protocol/bittorrent/tracker.c +++ b/src/protocol/bittorrent/tracker.c @@ -253,7 +253,7 @@ do_send_bittorrent_tracker_request(struct connection *conn) if (get_opt_bool("protocol.bittorrent.tracker.compact", NULL)) add_to_string(&request, "&compact=1"); - uri = get_uri(request.source, 0); + uri = get_uri(request.source, URI_NONE); done_string(&request); if (!uri) { if (!stopped) diff --git a/src/protocol/proxy.c b/src/protocol/proxy.c index 075f7c7c..77b752f5 100644 --- a/src/protocol/proxy.c +++ b/src/protocol/proxy.c @@ -66,7 +66,7 @@ proxy_uri(struct uri *uri, char *proxy, /* There is no need to use URI_BASE when calling get_uri() * because URI_BASE should not add any fragments in the first * place. */ - uri = get_uri(string.source, 0); + uri = get_uri(string.source, URI_NONE); /* XXX: Assume the problem is due to @proxy having bad format. * This is a lot faster easier than checking the format. */ if (!uri) diff --git a/src/protocol/uri.c b/src/protocol/uri.c index 8c4fd764..2099a96d 100644 --- a/src/protocol/uri.c +++ b/src/protocol/uri.c @@ -1308,7 +1308,7 @@ get_composed_uri(struct uri *uri, enum uri_component components) string = get_uri_string(uri, components); if (!string) return NULL; - uri = get_uri(string, 0); + uri = get_uri(string, URI_NONE); mem_free(string); return uri; @@ -1322,7 +1322,7 @@ get_translated_uri(char *uristring, char *cwd) uristring = translate_url(uristring, cwd); if (!uristring) return NULL; - uri = get_uri(uristring, 0); + uri = get_uri(uristring, URI_NONE); mem_free(uristring); return uri; diff --git a/src/protocol/uri.h b/src/protocol/uri.h index 05f74111..7d5e9dcf 100644 --- a/src/protocol/uri.h +++ b/src/protocol/uri.h @@ -121,7 +121,7 @@ enum uri_errno parse_uri(struct uri *uri, char *uristring); enum uri_component { /**** The "raw" URI components */ - + URI_NONE = 0, URI_PROTOCOL = (1 << 0), URI_IP_FAMILY = (1 << 1), URI_USER = (1 << 2), diff --git a/src/scripting/smjs/load_uri.c b/src/scripting/smjs/load_uri.c index ed0d5935..99df1da1 100644 --- a/src/scripting/smjs/load_uri.c +++ b/src/scripting/smjs/load_uri.c @@ -85,7 +85,7 @@ smjs_load_uri(JSContext *ctx, unsigned int argc, JS::Value *rval) uri_string = jsval_to_string(smjs_ctx, args[0]); if (!uri_string || !*uri_string) return false; - uri = get_uri(uri_string, 0); + uri = get_uri(uri_string, URI_NONE); if (!uri) return false; external_handler = get_protocol_external_handler(NULL, uri); diff --git a/src/scripting/smjs/session_object.c b/src/scripting/smjs/session_object.c index 819aae02..73361ed9 100644 --- a/src/scripting/smjs/session_object.c +++ b/src/scripting/smjs/session_object.c @@ -1147,7 +1147,7 @@ smjs_session_goto_url(JSContext *ctx, unsigned int argc, JS::Value *rval) url = jsval_to_string(ctx, args[0]); if (!url) return false; - uri = get_uri(url, 0); + uri = get_uri(url, URI_NONE); if (!uri) return false; deo = mem_calloc(1, sizeof(*deo)); diff --git a/src/session/download.c b/src/session/download.c index eb3db7c9..20915a3c 100644 --- a/src/session/download.c +++ b/src/session/download.c @@ -366,7 +366,7 @@ exec_mailcap_command(void *data) struct string string; if (init_string(&string)) { - struct uri *ref = get_uri("mailcap:elmailcap", 0); + struct uri *ref = get_uri("mailcap:elmailcap", URI_NONE); struct uri *uri; struct session *ses = exec_mailcap->ses; @@ -377,7 +377,7 @@ exec_mailcap_command(void *data) add_to_string(&string, exec_mailcap->file); } - uri = get_uri(string.source, 0); + uri = get_uri(string.source, URI_NONE); done_string(&string); set_session_referrer(ses, ref); if (ref) done_uri(ref); diff --git a/src/session/session.c b/src/session/session.c index 80e96ea5..bfe5b21b 100644 --- a/src/session/session.c +++ b/src/session/session.c @@ -1310,7 +1310,7 @@ decode_session_info(struct terminal *term, struct terminal_info *info) struct session *ses; if (!uri) - uri = get_uri("about:blank", 0); + uri = get_uri("about:blank", URI_NONE); ses = init_session(base_session, term, uri, backgrounded); if (!ses) { diff --git a/src/session/task.c b/src/session/task.c index d1fa2057..ac2d76df 100644 --- a/src/session/task.c +++ b/src/session/task.c @@ -725,7 +725,7 @@ map_selected(struct terminal *term, void *ld_, void *ses_) { struct link_def *ld = ld_; struct session *ses = ses_; - struct uri *uri = get_uri(ld->link, 0); + struct uri *uri = get_uri(ld->link, URI_NONE); goto_uri_frame(ses, uri, ld->target, CACHE_MODE_NORMAL); if (uri) done_uri(uri); @@ -735,7 +735,7 @@ map_selected(struct terminal *term, void *ld_, void *ses_) void goto_url(struct session *ses, char *url) { - struct uri *uri = get_uri(url, 0); + struct uri *uri = get_uri(url, URI_NONE); goto_uri(ses, uri); if (uri) done_uri(uri); diff --git a/src/viewer/text/form.c b/src/viewer/text/form.c index 50858fde..e3a4c9be 100644 --- a/src/viewer/text/form.c +++ b/src/viewer/text/form.c @@ -1375,7 +1375,7 @@ get_form_uri(struct session *ses, struct document_view *doc_view, done_string(&data); - uri = get_uri(go.source, 0); + uri = get_uri(go.source, URI_NONE); done_string(&go); if (uri) { uri->form = 1; @@ -2034,7 +2034,7 @@ get_form_info(struct session *ses, struct document_view *doc_view) ses))) break; - uri = get_uri(fc->form->action, 0); + uri = get_uri(fc->form->action, URI_NONE); if (!uri) break; /* Add the uri with password and post info stripped */ diff --git a/src/viewer/text/link.c b/src/viewer/text/link.c index 7700280e..2072072b 100644 --- a/src/viewer/text/link.c +++ b/src/viewer/text/link.c @@ -892,8 +892,8 @@ get_link_uri(struct session *ses, struct document_view *doc_view, switch (link->type) { case LINK_HYPERTEXT: case LINK_MAP: - if (link->where) return get_uri(link->where, 0); - return get_uri(link->where_img, 0); + if (link->where) return get_uri(link->where, URI_NONE); + return get_uri(link->where_img, URI_NONE); case LINK_BUTTON: case LINK_FIELD: diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index 62dcf85c..974f6a11 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -1782,7 +1782,7 @@ download_link(struct session *ses, struct document_view *doc_view, case ACT_MAIN_LINK_DOWNLOAD_IMAGE: if (!link->where_img) break; - ses->download_uri = get_uri(link->where_img, 0); + ses->download_uri = get_uri(link->where_img, URI_NONE); break; default: