1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

Revert "int_min instead of int_max. Valgrind said: invalid read"

I am reverting all copiousoutput support because of bug 917.
This reverts commit a2c12d7653.

Conflicts:

	src/session/download.c: The int_min vs. int_max change had
	  already been obsoleted by using safe_strncpy instead,
	  in commit efcd6c9758 for bug 896 on 2007-07-24.
	  Also, TERM_EXEC_FG and TERM_EXEC_BG had been added.
This commit is contained in:
Kalle Olavi Niemitalo 2008-06-15 14:31:17 +03:00 committed by Kalle Olavi Niemitalo
parent 6e0d4cf4bf
commit 196c3a8134

View File

@ -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"
@ -1043,24 +1042,6 @@ tp_display(struct type_query *type_query)
done_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)
{
@ -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. */