diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-27 07:33:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-27 07:33:29 +0800 |
commit | 58b29e344c639e47fd916129d2195883537357b6 (patch) | |
tree | 2a6d4599e7549786d624756ac8d6e4cfd46fce83 /src/nvim/os/env.c | |
parent | d5e08837128530f05b2fc8900e826f767e4961ee (diff) | |
parent | 608134794d2a039358825396b860a7f432c1a4bd (diff) | |
download | rneovim-58b29e344c639e47fd916129d2195883537357b6.tar.gz rneovim-58b29e344c639e47fd916129d2195883537357b6.tar.bz2 rneovim-58b29e344c639e47fd916129d2195883537357b6.zip |
Merge pull request #19962 from zeertzjq/vim-9.0.0278
vim-patch:9.0.{0278,0279,0283,0284}: cmdline completion patches
Diffstat (limited to 'src/nvim/os/env.c')
-rw-r--r-- | src/nvim/os/env.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index d46d51882e..ea9a803a86 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -1156,15 +1156,12 @@ char *home_replace_save(buf_T *buf, const char *src) /// Function given to ExpandGeneric() to obtain an environment variable name. char *get_env_name(expand_T *xp, int idx) { -#define ENVNAMELEN 100 - // this static buffer is needed to avoid a memory leak in ExpandGeneric - static char_u name[ENVNAMELEN]; assert(idx >= 0); char *envname = os_getenvname_at_index((size_t)idx); if (envname) { - STRLCPY(name, envname, ENVNAMELEN); + STRLCPY(xp->xp_buf, envname, EXPAND_BUF_LEN); xfree(envname); - return (char *)name; + return xp->xp_buf; } return NULL; } |