aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/stdpaths.c
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-09-06 18:05:30 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-09-06 09:05:30 -0700
commit64caeb13e68c9858ae41ce04131a6f623be5b54d (patch)
tree111aa4cbe8358d697aa5d5ef97522fbd5e3e1067 /src/nvim/os/stdpaths.c
parentfecbafb29e19d49ab48f98382b2750f0265a0947 (diff)
downloadrneovim-64caeb13e68c9858ae41ce04131a6f623be5b54d.tar.gz
rneovim-64caeb13e68c9858ae41ce04131a6f623be5b54d.tar.bz2
rneovim-64caeb13e68c9858ae41ce04131a6f623be5b54d.zip
stdpaths_get_xdg_var: consider empty env vars #10953
Without this "sysinit uses VIM if XDG_CONFIG_DIRS unset" fails with an existing `/etc/xdg/nvim/sysinit.vim` file, because `XDG_CONFIG_DIRS=` is not considered, but the default ("/etc/xdg") used then.
Diffstat (limited to 'src/nvim/os/stdpaths.c')
-rw-r--r--src/nvim/os/stdpaths.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/os/stdpaths.c b/src/nvim/os/stdpaths.c
index 91ee45d3a9..66bc990402 100644
--- a/src/nvim/os/stdpaths.c
+++ b/src/nvim/os/stdpaths.c
@@ -68,6 +68,10 @@ char *stdpaths_get_xdg_var(const XDGVarType idx)
if (env_val == NULL && xdg_defaults_env_vars[idx] != NULL) {
env_val = os_getenv(xdg_defaults_env_vars[idx]);
}
+#else
+ if (env_val == NULL && os_env_exists(env)) {
+ env_val = "";
+ }
#endif
char *ret = NULL;