From 196c3a81344f1e27400303a62bee03af48f3a356 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 15 Jun 2008 14:31:17 +0300 Subject: [PATCH] Revert "int_min instead of int_max. Valgrind said: invalid read" I am reverting all copiousoutput support because of bug 917. This reverts commit a2c12d76539f20cef8780904f71f61430b0141ef. Conflicts: src/session/download.c: The int_min vs. int_max change had already been obsoleted by using safe_strncpy instead, in commit efcd6c975808b250 for bug 896 on 2007-07-24. Also, TERM_EXEC_FG and TERM_EXEC_BG had been added. --- src/session/download.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/session/download.c b/src/session/download.c index 3215e64d..44d5e84c 100644 --- a/src/session/download.c +++ b/src/session/download.c @@ -32,7 +32,6 @@ #include "dialogs/menu.h" #include "intl/gettext/libintl.h" #include "main/object.h" -#include "main/select.h" #include "mime/mime.h" #include "network/connection.h" #include "network/progress.h" @@ -1044,24 +1043,6 @@ tp_display(struct type_query *type_query) } static void -read_from_popen(struct type_query *type_query, unsigned char *handler) -{ - FILE *pop = popen(handler, "r"); - - if (pop) { - int fd = fileno(pop); - - if (fd > 0) { - struct session *ses = type_query->ses; - unsigned char buf[48]; - - snprintf(buf, 48, "file:///dev/fd/%d", fd); - goto_url(ses, buf); - } - } -} - -static void tp_open(struct type_query *type_query) { if (!type_query->external_handler || !*type_query->external_handler) { @@ -1080,10 +1061,7 @@ tp_open(struct type_query *type_query) } if (handler) { - if (type_query->copiousoutput) - read_from_popen(type_query, handler); - else - exec_on_terminal(type_query->ses->tab->term, + exec_on_terminal(type_query->ses->tab->term, handler, "", type_query->block ? TERM_EXEC_FG : TERM_EXEC_BG); mem_free(handler); @@ -1310,7 +1288,7 @@ setup_download_handler(struct session *ses, struct download *loading, type_query = init_type_query(ses, loading, cached); if (type_query) { ret = 1; - if (handler) type_query->copiousoutput = handler->copiousoutput; + type_query->copiousoutput = handler->copiousoutput; #ifdef CONFIG_BITTORRENT /* A terrible waste of a good MIME handler here, but we want * to use the type_query this is easier. */ -- 2.11.4.GIT