mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 13:26:06 +00:00
vim_getenv: Use v:progpath instead of os_exepath.
This commit is contained in:
@@ -634,8 +634,8 @@ char *vim_getenv(const char *name)
|
|||||||
char exe_name[MAXPATHL];
|
char exe_name[MAXPATHL];
|
||||||
// Find runtime path relative to the nvim binary: ../share/nvim/runtime
|
// Find runtime path relative to the nvim binary: ../share/nvim/runtime
|
||||||
if (vim_path == NULL) {
|
if (vim_path == NULL) {
|
||||||
size_t exe_name_len = MAXPATHL;
|
xstrlcpy(exe_name, (char *)get_vim_var_str(VV_PROGPATH),
|
||||||
if (os_exepath(exe_name, &exe_name_len) == 0) {
|
sizeof(exe_name));
|
||||||
char *path_end = (char *)path_tail_with_sep((char_u *)exe_name);
|
char *path_end = (char *)path_tail_with_sep((char_u *)exe_name);
|
||||||
*path_end = '\0'; // remove the trailing "nvim.exe"
|
*path_end = '\0'; // remove the trailing "nvim.exe"
|
||||||
path_end = (char *)path_tail((char_u *)exe_name);
|
path_end = (char *)path_tail((char_u *)exe_name);
|
||||||
@@ -647,7 +647,6 @@ char *vim_getenv(const char *name)
|
|||||||
vim_path = exe_name; // -V507
|
vim_path = exe_name; // -V507
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (vim_path != NULL) {
|
if (vim_path != NULL) {
|
||||||
// remove the file name
|
// remove the file name
|
||||||
|
Reference in New Issue
Block a user