From 89515304e4eb81ff9eb65f3a582136fc658de139 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 24 Feb 2019 20:09:14 +0100 Subject: os/env: use libuv v1.12 getenv/setenv API - Minimum required libuv is now v1.12 - Because `uv_os_getenv` requires allocating, we must manage a map (`envmap` in `env.c`) to maintain the old behavior of `os_getenv` . - free() map-items after removal. khash.h does not make copies of anything, so even its keys must be memory-managed by the caller. closes #8398 closes #9267 --- src/nvim/os/pty_process_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/os/pty_process_unix.c') diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c index bcf57e1b5b..9ff0399511 100644 --- a/src/nvim/os/pty_process_unix.c +++ b/src/nvim/os/pty_process_unix.c @@ -177,7 +177,7 @@ static void init_child(PtyProcess *ptyproc) } char *prog = ptyproc->process.argv[0]; - setenv("TERM", ptyproc->term_name ? ptyproc->term_name : "ansi", 1); + os_setenv("TERM", ptyproc->term_name ? ptyproc->term_name : "ansi", 1); execvp(prog, ptyproc->process.argv); ELOG("execvp failed: %s: %s", strerror(errno), prog); _exit(122); // 122 is EXEC_FAILED in the Vim source. -- cgit From 900e96781f09f5e4d6b89be07391b35fcec1d1f4 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 26 Feb 2019 02:43:06 +0100 Subject: clint: check env functions --- src/nvim/os/pty_process_unix.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/nvim/os/pty_process_unix.c') diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c index 9ff0399511..5fdf0e6181 100644 --- a/src/nvim/os/pty_process_unix.c +++ b/src/nvim/os/pty_process_unix.c @@ -157,11 +157,11 @@ static void init_child(PtyProcess *ptyproc) // New session/process-group. #6530 setsid(); - unsetenv("COLUMNS"); - unsetenv("LINES"); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); + os_unsetenv("COLUMNS"); + os_unsetenv("LINES"); + os_unsetenv("TERMCAP"); + os_unsetenv("COLORTERM"); + os_unsetenv("COLORFGBG"); signal(SIGCHLD, SIG_DFL); signal(SIGHUP, SIG_DFL); -- cgit