1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

copiousoutput: Use current frame.

Use the current frame instead full screen. Do not add the "zombie"
popen_data in case of the memory allocation error.
This commit is contained in:
Witold Filipczyk 2007-03-13 21:10:21 +01:00 committed by Witold Filipczyk
parent b6e862f539
commit a494f376f9
3 changed files with 12 additions and 18 deletions

View File

@ -311,7 +311,7 @@ read_from_popen(struct session *ses, unsigned char *handler, unsigned char *file
if (stream) {
int fd = fileno(stream);
if (fd > 0) {
if (fd >= 0) {
unsigned char buf[48];
struct popen_data *data = mem_calloc(1, sizeof(*data));
@ -321,17 +321,23 @@ read_from_popen(struct session *ses, unsigned char *handler, unsigned char *file
fclose(stream);
return;
}
deo = mem_calloc(1, sizeof(*deo));
if (!deo) {
mem_free(data);
fclose(stream);
return;
}
data->fd = fd;
data->stream = stream;
if (filename) data->filename = stracpy(filename);
add_to_list(copiousoutput_data, data);
deo = mem_calloc(1, sizeof(*deo));
if (!deo) return;
snprintf(buf, 48, "file:///dev/fd/%d", fd);
deo->uri = get_uri(buf, 0);
deo->ses = ses;
register_bottom_half(delayed_goto_uri, deo);
if (ses->task.target.frame && *ses->task.target.frame) {
deo->target = stracpy(ses->task.target.frame);
}
register_bottom_half(delayed_goto_uri_frame, deo);
}
}
}

View File

@ -678,18 +678,7 @@ delayed_goto_uri_frame(void *data)
goto_uri_frame(deo->ses, deo->uri, NULL, CACHE_MODE_NORMAL);
}
done_uri(deo->uri);
mem_free(deo->target);
mem_free(deo);
}
void
delayed_goto_uri(void *data)
{
struct delayed_open *deo = data;
assert(deo);
goto_uri(deo->ses, deo->uri);
done_uri(deo->uri);
mem_free_if(deo->target);
mem_free(deo);
}

View File

@ -28,7 +28,6 @@ struct uri *get_hooked_uri(unsigned char *uristring, struct session *ses, unsign
void goto_uri(struct session *ses, struct uri *uri);
void goto_uri_frame(struct session *, struct uri *, unsigned char *, enum cache_mode);
void delayed_goto_uri_frame(void *);
void delayed_goto_uri(void *);
void goto_url(struct session *, unsigned char *);
void goto_url_with_hook(struct session *, unsigned char *);
int goto_url_home(struct session *ses);