Skip to content

Commit 5d96e3a

Browse files
committed
patch 7.4.1825
Problem: When job writes to buffer nothing is written. (Nicola) Solution: Do not discard a channel before writing is done.
1 parent 36e0f7d commit 5d96e3a

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/channel.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ channel_still_useful(channel_T *channel)
352352
if (channel->ch_close_cb != NULL)
353353
return TRUE;
354354

355+
/* If reading from or a buffer it's still useful. */
356+
if (channel->ch_part[PART_IN].ch_buffer != NULL)
357+
return TRUE;
358+
355359
/* If there is no callback then nobody can get readahead. If the fd is
356360
* closed and there is no readahead then the callback won't be called. */
357361
has_sock_msg = channel->ch_part[PART_SOCK].ch_fd != INVALID_FD
@@ -365,8 +369,10 @@ channel_still_useful(channel_T *channel)
365369
|| channel->ch_part[PART_ERR].ch_json_head.jq_next != NULL;
366370
return (channel->ch_callback != NULL && (has_sock_msg
367371
|| has_out_msg || has_err_msg))
368-
|| (channel->ch_part[PART_OUT].ch_callback != NULL && has_out_msg)
369-
|| (channel->ch_part[PART_ERR].ch_callback != NULL && has_err_msg);
372+
|| ((channel->ch_part[PART_OUT].ch_callback != NULL
373+
|| channel->ch_part[PART_OUT].ch_buffer) && has_out_msg)
374+
|| ((channel->ch_part[PART_ERR].ch_callback != NULL
375+
|| channel->ch_part[PART_ERR].ch_buffer) && has_err_msg);
370376
}
371377

372378
/*

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ static char *(features[]) =
753753

754754
static int included_patches[] =
755755
{ /* Add new patch number below this line */
756+
/**/
757+
1825,
756758
/**/
757759
1824,
758760
/**/

0 commit comments

Comments
 (0)