aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/channel.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2020-07-31 01:17:24 -0400
committerJames McCoy <jamessan@jamessan.com>2021-01-31 07:54:20 -0500
commit7f50c692685c92d47e6ba6c3ee5f6fdccb78fec5 (patch)
tree2d1eda8d6437d4d339c244681fdb5b7ff5418c21 /src/nvim/channel.c
parent55add1c1c8a9a040f02a880096ca153f7db3e501 (diff)
downloadrneovim-7f50c692685c92d47e6ba6c3ee5f6fdccb78fec5.tar.gz
rneovim-7f50c692685c92d47e6ba6c3ee5f6fdccb78fec5.tar.bz2
rneovim-7f50c692685c92d47e6ba6c3ee5f6fdccb78fec5.zip
Use dict_T to pass env vars to process spawning code
Co-authored-by: Matthieu Coudron <mattator@gmail.com>
Diffstat (limited to 'src/nvim/channel.c')
-rw-r--r--src/nvim/channel.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/channel.c b/src/nvim/channel.c
index 37cbfb968b..5628ede2e6 100644
--- a/src/nvim/channel.c
+++ b/src/nvim/channel.c
@@ -304,7 +304,8 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout,
bool pty, bool rpc, bool overlapped, bool detach,
const char *cwd,
uint16_t pty_width, uint16_t pty_height,
- char *term_name, char **env, varnumber_T *status_out)
+ char *term_name, dict_T *env,
+ varnumber_T *status_out)
{
assert(cwd == NULL || os_isdir_executable(cwd));
@@ -358,7 +359,9 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout,
if (status) {
EMSG3(_(e_jobspawn), os_strerror(status), cmd);
xfree(cmd);
- os_free_fullenv(proc->env);
+ if (proc->env) {
+ tv_dict_free(proc->env);
+ }
if (proc->type == kProcessTypePty) {
xfree(chan->stream.pty.term_name);
}
@@ -367,8 +370,9 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout,
return NULL;
}
xfree(cmd);
- os_free_fullenv(proc->env);
-
+ if (proc->env) {
+ tv_dict_free(proc->env);
+ }
wstream_init(&proc->in, 0);
if (has_out) {