On Monday, March 7, 2016 at 7:12:12 AM UTC+9, Bram Moolenaar wrote:
> I wrote:
> 
> > Patch 7.4.1506
> > Problem:    Job cannot read from a file.
> > Solution:   Implement reading from a file for Unix.
> > Files:      src/eval.c, src/os_unix.c, src/os_win32.c,
> >             src/testdir/test_channel.vim
> 
> I would appreciate it if someone can implement this for MS-Windows.

Will do. BTW, then job_start got failed, channel_write_io crash.

diff --git a/src/channel.c b/src/channel.c
index e7c25ac..dc059f9 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1024,13 +1024,17 @@ write_buf_line(buf_T *buf, linenr_T lnum, channel_T 
*channel)
     void
 channel_write_in(channel_T *channel)
 {
-    chanpart_T *in_part = &channel->ch_part[PART_IN];
+    chanpart_T *in_part;
     linenr_T    lnum;
-    buf_T      *buf = in_part->ch_buffer;
+    buf_T      *buf;
     int                written = 0;
 
-    if (buf == NULL)
+    if (buf == NULL || channel == NULL)
        return;
+
+    in_part = &channel->ch_part[PART_IN];
+    buf = in_part->ch_buffer;
+
     if (!buf_valid(buf) || buf->b_ml.ml_mfp == NULL)
     {
        /* buffer was wiped out or unloaded */

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui