Permalink
Browse files

Merge pull request #8746 from oni-link/fix.rpcstart2

Fix crash in channel_job_start() in combination with rpc and unknown command
  • Loading branch information...
bfredl committed Jul 15, 2018
2 parents 4874214 + c180741 commit c230ef24a2b5bcd21902ca7fd89ff9ecd455638f
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/nvim/channel.c
@@ -288,7 +288,6 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout,
chan->on_stdout = on_stdout;
chan->on_stderr = on_stderr;
chan->on_exit = on_exit;
chan->is_rpc = rpc;
if (pty) {
if (detach) {
@@ -326,7 +325,7 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout,
has_out = true;
has_err = false;
} else {
has_out = chan->is_rpc || callback_reader_set(chan->on_stdout);
has_out = rpc || callback_reader_set(chan->on_stdout);
has_err = callback_reader_set(chan->on_stderr);
}
int status = process_spawn(proc, true, has_out, has_err);
@@ -347,7 +346,7 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout,
rstream_init(&proc->out, 0);
}
if (chan->is_rpc) {
if (rpc) {
// the rpc takes over the in and out streams
rpc_start(chan);
} else {

0 comments on commit c230ef2

Please sign in to comment.