mirror of
https://github.com/neovim/neovim.git
synced 2025-11-11 21:08:53 +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:
@@ -829,18 +829,16 @@ static void init_locale(void)
|
||||
# endif
|
||||
|
||||
{
|
||||
bool mustfree = false;
|
||||
char_u *p;
|
||||
|
||||
/* expand_env() doesn't work yet, because chartab[] is not initialized
|
||||
* yet, call vim_getenv() directly */
|
||||
p = (char_u *)vim_getenv("VIMRUNTIME", &mustfree);
|
||||
p = (char_u *)vim_getenv("VIMRUNTIME");
|
||||
if (p != NULL && *p != NUL) {
|
||||
vim_snprintf((char *)NameBuff, MAXPATHL, "%s/lang", p);
|
||||
bindtextdomain(VIMPACKAGE, (char *)NameBuff);
|
||||
}
|
||||
if (mustfree)
|
||||
xfree(p);
|
||||
xfree(p);
|
||||
textdomain(VIMPACKAGE);
|
||||
}
|
||||
TIME_MSG("locale set");
|
||||
|
||||
Reference in New Issue
Block a user