From 6dc10057876d1bf75c5cf1ea45cb4312160f13f0 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 2 Jun 2019 14:36:17 -0400 Subject: Add os_getfullenv_size/os_copyfullenv --- src/nvim/channel.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/nvim/channel.c') diff --git a/src/nvim/channel.c b/src/nvim/channel.c index f8b480adcb..2bb568f025 100644 --- a/src/nvim/channel.c +++ b/src/nvim/channel.c @@ -272,15 +272,6 @@ static void close_cb(Stream *stream, void *data) channel_decref(data); } -static inline void free_env(char **env) -{ - if (!env) { return; } - for (char **it = env; *it; it++) { - XFREE_CLEAR(*it); - } - xfree(env); -} - /// Starts a job and returns the associated channel /// @@ -362,7 +353,7 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout, if (status) { EMSG3(_(e_jobspawn), os_strerror(status), cmd); xfree(cmd); - free_env(proc->env); + os_free_fullenv(proc->env); if (proc->type == kProcessTypePty) { xfree(chan->stream.pty.term_name); } @@ -371,7 +362,7 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout, return NULL; } xfree(cmd); - free_env(proc->env); + os_free_fullenv(proc->env); wstream_init(&proc->in, 0); -- cgit