From d0be89a16c13d0b228c9dae40bd6cb4137f75b57 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 7 Jan 2006 20:19:37 +0100 Subject: [PATCH] When requested to open local files with a handler use the file in place Everything else is really stupid, i.e. to go through the callback-infested download code. A parly fix of bug 238 (caching of local files). --- src/session/download.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/session/download.c b/src/session/download.c index fa968a762..69db67369 100644 --- a/src/session/download.c +++ b/src/session/download.c @@ -985,6 +985,25 @@ tp_open(struct type_query *type_query) return; } + if (type_query->uri->protocol == PROTOCOL_FILE) { + unsigned char *file = get_uri_string(type_query->uri, URI_PATH); + unsigned char *handler = NULL; + + if (file) { + handler = subst_file(type_query->external_handler, file); + mem_free(file); + } + + if (handler) { + exec_on_terminal(type_query->ses->tab->term, + handler, "", !!type_query->block); + mem_free(handler); + } + + done_type_query(type_query); + return; + } + continue_download(type_query, ""); }