mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
Revert "Copiousoutput final stage. I doubt that /dev/fd/%d is portable. It works"
I am reverting all copiousoutput support because of bug 917.
This reverts commit 6ead4e9c65
.
Conflicts:
src/session/download.c: TERM_EXEC_FG and TERM_EXEC_BG had been
added after the original commit.
This commit is contained in:
parent
bfb034c953
commit
6e0d4cf4bf
@ -545,7 +545,7 @@ format_command(unsigned char *command, unsigned char *type, int copiousoutput)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
|
||||
if (copiousoutput) {
|
||||
unsigned char *pager = getenv("PAGER");
|
||||
|
||||
@ -562,7 +562,7 @@ format_command(unsigned char *command, unsigned char *type, int copiousoutput)
|
||||
add_to_string(&cmd, pager);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return cmd.source;
|
||||
}
|
||||
|
||||
|
@ -302,23 +302,6 @@ abort_download_and_beep(struct file_download *file_download, struct terminal *te
|
||||
abort_download(file_download);
|
||||
}
|
||||
|
||||
static void
|
||||
read_from_popen(struct session *ses, unsigned char *handler)
|
||||
{
|
||||
FILE *pop = popen(handler, "r");
|
||||
|
||||
if (pop) {
|
||||
int fd = fileno(pop);
|
||||
|
||||
if (fd > 0) {
|
||||
unsigned char buf[48];
|
||||
|
||||
snprintf(buf, 48, "file:///dev/fd/%d", fd);
|
||||
goto_url(ses, buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
download_data_store(struct download *download, struct file_download *file_download)
|
||||
{
|
||||
@ -356,16 +339,11 @@ download_data_store(struct download *download, struct file_download *file_downlo
|
||||
prealloc_truncate(file_download->handle, file_download->seek);
|
||||
close(file_download->handle);
|
||||
file_download->handle = -1;
|
||||
if (file_download->copiousoutput) {
|
||||
read_from_popen(file_download->ses,
|
||||
file_download->external_handler);
|
||||
} else {
|
||||
exec_on_terminal(term, file_download->external_handler,
|
||||
exec_on_terminal(term, file_download->external_handler,
|
||||
file_download->file,
|
||||
file_download->block ? TERM_EXEC_FG : TERM_EXEC_BG);
|
||||
file_download->delete = 0;
|
||||
abort_download_and_beep(file_download, term);
|
||||
}
|
||||
file_download->delete = 0;
|
||||
abort_download_and_beep(file_download, term);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1065,6 +1043,23 @@ 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)
|
||||
@ -1086,7 +1081,7 @@ tp_open(struct type_query *type_query)
|
||||
|
||||
if (handler) {
|
||||
if (type_query->copiousoutput)
|
||||
read_from_popen(type_query->ses, handler);
|
||||
read_from_popen(type_query, handler);
|
||||
else
|
||||
exec_on_terminal(type_query->ses->tab->term,
|
||||
handler, "",
|
||||
|
Loading…
Reference in New Issue
Block a user