startup: init v:progpath before calling vim_getenv (#6755)

This commit is contained in:
Justin M. Keyes
2017-05-17 03:23:34 +02:00
committed by GitHub
parent 96ede7c567
commit 060ce0e0bc
2 changed files with 14 additions and 11 deletions

View File

@@ -600,6 +600,10 @@ const void *vim_env_iter_rev(const char delim,
/// @param name Environment variable to expand
char *vim_getenv(const char *name)
{
// init_path() should have been called before now.
assert(get_vim_var_str(VV_PROGPATH)
&& get_vim_var_str(VV_PROGPATH)[0] != NUL);
const char *kos_env_path = os_getenv(name);
if (kos_env_path != NULL) {
return xstrdup(kos_env_path);