mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 01:38:16 +00:00
Refactor get_env() to respect const qualifier
Without the casts*, the compiler rightly warns about the os_getenv losing the qualifier. This refactor adds a variable to manage this properly, and renames the original variables to increase clarity.
This commit is contained in:
@@ -5061,7 +5061,6 @@ void fix_help_buffer(void)
|
||||
char_u *fname;
|
||||
char_u *p;
|
||||
char_u *rt;
|
||||
bool mustfree;
|
||||
|
||||
/* set filetype to "help". */
|
||||
set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL);
|
||||
@@ -5116,8 +5115,7 @@ void fix_help_buffer(void)
|
||||
p = p_rtp;
|
||||
while (*p != NUL) {
|
||||
copy_option_part(&p, NameBuff, MAXPATHL, ",");
|
||||
mustfree = FALSE;
|
||||
rt = (char_u *)vim_getenv("VIMRUNTIME", &mustfree);
|
||||
rt = (char_u *)vim_getenv("VIMRUNTIME");
|
||||
if (path_full_compare(rt, NameBuff, FALSE) != kEqualFiles) {
|
||||
int fcount;
|
||||
char_u **fnames;
|
||||
@@ -5242,8 +5240,7 @@ void fix_help_buffer(void)
|
||||
FreeWild(fcount, fnames);
|
||||
}
|
||||
}
|
||||
if (mustfree)
|
||||
xfree(rt);
|
||||
xfree(rt);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user