mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 14:28:18 +00:00
exists(): return false for empty env var #10657
Fixes https://github.com/neovim/neovim/issues/3266 close #10657
This commit is contained in:

committed by
Justin M. Keyes

parent
5aa97937e7
commit
06d9cc734b
@@ -8718,7 +8718,7 @@ static void f_exists(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
const char *p = tv_get_string(&argvars[0]);
|
||||
if (*p == '$') { // Environment variable.
|
||||
// First try "normal" environment variables (fast).
|
||||
if (os_getenv(p + 1) != NULL) {
|
||||
if (os_env_exists(p + 1)) {
|
||||
n = true;
|
||||
} else {
|
||||
// Try expanding things like $VIM and ${HOME}.
|
||||
|
Reference in New Issue
Block a user