mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04: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 6ead4e9c65928ab99350c717621755ce4b39be9e. 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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
if (copiousoutput) {
|
if (copiousoutput) {
|
||||||
unsigned char *pager = getenv("PAGER");
|
unsigned char *pager = getenv("PAGER");
|
||||||
|
|
||||||
@ -562,7 +562,7 @@ format_command(unsigned char *command, unsigned char *type, int copiousoutput)
|
|||||||
add_to_string(&cmd, pager);
|
add_to_string(&cmd, pager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return cmd.source;
|
return cmd.source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,23 +302,6 @@ abort_download_and_beep(struct file_download *file_download, struct terminal *te
|
|||||||
abort_download(file_download);
|
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
|
static void
|
||||||
download_data_store(struct download *download, struct file_download *file_download)
|
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);
|
prealloc_truncate(file_download->handle, file_download->seek);
|
||||||
close(file_download->handle);
|
close(file_download->handle);
|
||||||
file_download->handle = -1;
|
file_download->handle = -1;
|
||||||
if (file_download->copiousoutput) {
|
exec_on_terminal(term, file_download->external_handler,
|
||||||
read_from_popen(file_download->ses,
|
|
||||||
file_download->external_handler);
|
|
||||||
} else {
|
|
||||||
exec_on_terminal(term, file_download->external_handler,
|
|
||||||
file_download->file,
|
file_download->file,
|
||||||
file_download->block ? TERM_EXEC_FG : TERM_EXEC_BG);
|
file_download->block ? TERM_EXEC_FG : TERM_EXEC_BG);
|
||||||
file_download->delete = 0;
|
file_download->delete = 0;
|
||||||
abort_download_and_beep(file_download, term);
|
abort_download_and_beep(file_download, term);
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1065,6 +1043,23 @@ tp_display(struct type_query *type_query)
|
|||||||
done_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
|
static void
|
||||||
tp_open(struct type_query *type_query)
|
tp_open(struct type_query *type_query)
|
||||||
@ -1086,7 +1081,7 @@ tp_open(struct type_query *type_query)
|
|||||||
|
|
||||||
if (handler) {
|
if (handler) {
|
||||||
if (type_query->copiousoutput)
|
if (type_query->copiousoutput)
|
||||||
read_from_popen(type_query->ses, handler);
|
read_from_popen(type_query, handler);
|
||||||
else
|
else
|
||||||
exec_on_terminal(type_query->ses->tab->term,
|
exec_on_terminal(type_query->ses->tab->term,
|
||||||
handler, "",
|
handler, "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user