diff options
author | James McCoy <jamessan@jamessan.com> | 2018-10-03 10:04:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-03 10:04:54 -0400 |
commit | 94e585944dac3a1f7b75641676c4b4a3b2054749 (patch) | |
tree | e8e40e8ea897f201242a6deeef3a4ffb9932398c /src | |
parent | 65206714bc0990a469da5efd2edbe52e81903014 (diff) | |
parent | eb7b2c791296b26099395dbe2a5ec2b13f4fbdc5 (diff) | |
download | rneovim-94e585944dac3a1f7b75641676c4b4a3b2054749.tar.gz rneovim-94e585944dac3a1f7b75641676c4b4a3b2054749.tar.bz2 rneovim-94e585944dac3a1f7b75641676c4b4a3b2054749.zip |
Merge pull request #9081 from jamessan/embed-crash
Fix crash if --embed is used more than once
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/main.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 371c8d824e..1db988b5f4 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -258,6 +258,14 @@ int main(int argc, char **argv) // Process the command line arguments. File names are put in the global // argument list "global_alist". command_line_scan(¶ms); + + if (embedded_mode) { + const char *err; + if (!channel_from_stdio(true, CALLBACK_READER_INIT, &err)) { + abort(); + } + } + server_init(params.listen_addr); if (GARGCOUNT > 0) { @@ -848,10 +856,6 @@ static void command_line_scan(mparm_T *parmp) headless_mode = true; } else if (STRICMP(argv[0] + argv_idx, "embed") == 0) { embedded_mode = true; - const char *err; - if (!channel_from_stdio(true, CALLBACK_READER_INIT, &err)) { - abort(); - } } else if (STRNICMP(argv[0] + argv_idx, "listen", 6) == 0) { want_argument = true; argv_idx += 6; |