mirror of https://github.com/tmux/tmux.git
Discard all but the last line when reading from a #() command - the
callback is just going to be fired again straight away to go through all the lines, it is better just to use the last one straight away.pull/1247/head
parent
c9037fde1c
commit
17d4c39f24
9
format.c
9
format.c
|
@ -191,10 +191,15 @@ static void
|
|||
format_job_update(struct job *job)
|
||||
{
|
||||
struct format_job *fj = job->data;
|
||||
char *line;
|
||||
struct evbuffer *evb = job->event->input;
|
||||
char *line = NULL, *next;
|
||||
time_t t;
|
||||
|
||||
if ((line = evbuffer_readline(job->event->input)) == NULL)
|
||||
while ((next = evbuffer_readline(evb)) != NULL) {
|
||||
free(line);
|
||||
line = next;
|
||||
}
|
||||
if (line == NULL)
|
||||
return;
|
||||
fj->updated = 1;
|
||||
|
||||
|
|
Loading…
Reference in New Issue