mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 07:28:34 +00:00
Remove char_u: vim_setenv()
This commit is contained in:
@@ -808,7 +808,7 @@ static void diff_file(char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff)
|
||||
|
||||
/* We don't want $DIFF_OPTIONS to get in the way. */
|
||||
if (os_getenv("DIFF_OPTIONS")) {
|
||||
vim_setenv((char_u *)"DIFF_OPTIONS", (char_u *)"");
|
||||
vim_setenv("DIFF_OPTIONS", "");
|
||||
}
|
||||
|
||||
/* Build the diff command and execute it. Always use -a, binary
|
||||
|
@@ -1761,7 +1761,7 @@ ex_let_one (
|
||||
}
|
||||
}
|
||||
if (p != NULL) {
|
||||
vim_setenv(name, p);
|
||||
vim_setenv((char *)name, (char *)p);
|
||||
if (STRICMP(name, "HOME") == 0)
|
||||
init_homedir();
|
||||
else if (didset_vim && STRICMP(name, "VIM") == 0)
|
||||
|
@@ -3127,22 +3127,20 @@ void ex_language(exarg_T *eap)
|
||||
++_nl_msg_cat_cntr;
|
||||
#endif
|
||||
/* Reset $LC_ALL, otherwise it would overrule everything. */
|
||||
vim_setenv((char_u *)"LC_ALL", (char_u *)"");
|
||||
vim_setenv("LC_ALL", "");
|
||||
|
||||
if (what != LC_TIME) {
|
||||
/* Tell gettext() what to translate to. It apparently doesn't
|
||||
* use the currently effective locale. */
|
||||
if (what == LC_ALL) {
|
||||
vim_setenv((char_u *)"LANG", name);
|
||||
vim_setenv("LANG", (char *)name);
|
||||
|
||||
/* Clear $LANGUAGE because GNU gettext uses it. */
|
||||
vim_setenv((char_u *)"LANGUAGE", (char_u *)"");
|
||||
vim_setenv("LANGUAGE", "");
|
||||
}
|
||||
if (what != LC_CTYPE) {
|
||||
char_u *mname;
|
||||
mname = name;
|
||||
vim_setenv((char_u *)"LC_MESSAGES", mname);
|
||||
set_helplang_default(mname);
|
||||
vim_setenv("LC_MESSAGES", (char *)name);
|
||||
set_helplang_default((char *)name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2288,7 +2288,7 @@ void set_init_3(void)
|
||||
* When 'helplang' is still at its default value, set it to "lang".
|
||||
* Only the first two characters of "lang" are used.
|
||||
*/
|
||||
void set_helplang_default(char_u *lang)
|
||||
void set_helplang_default(const char *lang)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@@ -3644,11 +3644,11 @@ did_set_string_option (
|
||||
else if (varp == &p_hf) {
|
||||
/* May compute new values for $VIM and $VIMRUNTIME */
|
||||
if (didset_vim) {
|
||||
vim_setenv((char_u *)"VIM", (char_u *)"");
|
||||
vim_setenv("VIM", "");
|
||||
didset_vim = FALSE;
|
||||
}
|
||||
if (didset_vimruntime) {
|
||||
vim_setenv((char_u *)"VIMRUNTIME", (char_u *)"");
|
||||
vim_setenv("VIMRUNTIME", "");
|
||||
didset_vimruntime = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -7437,7 +7437,7 @@ void vimrc_found(char_u *fname, char_u *envname)
|
||||
/* Set $MYVIMRC to the first vimrc file found. */
|
||||
p = FullName_save(fname, FALSE);
|
||||
if (p != NULL) {
|
||||
vim_setenv(envname, p);
|
||||
vim_setenv((char *)envname, (char *)p);
|
||||
xfree(p);
|
||||
}
|
||||
} else if (dofree)
|
||||
|
@@ -528,10 +528,10 @@ char *vim_getenv(const char *name, bool *mustfree)
|
||||
*/
|
||||
if (p != NULL) {
|
||||
if (vimruntime) {
|
||||
vim_setenv((char_u *)"VIMRUNTIME", (char_u *)p);
|
||||
vim_setenv("VIMRUNTIME", p);
|
||||
didset_vimruntime = true;
|
||||
} else {
|
||||
vim_setenv((char_u *)"VIM", (char_u *)p);
|
||||
vim_setenv("VIM", p);
|
||||
didset_vim = true;
|
||||
}
|
||||
}
|
||||
@@ -664,16 +664,16 @@ char_u * home_replace_save(buf_T *buf, char_u *src) FUNC_ATTR_NONNULL_RET
|
||||
/// Our portable version of setenv.
|
||||
/// Has special handling for $VIMRUNTIME to keep the localization machinery
|
||||
/// sane.
|
||||
void vim_setenv(char_u *name, char_u *val)
|
||||
void vim_setenv(const char *name, const char *val)
|
||||
{
|
||||
os_setenv((char *)name, (char *)val, 1);
|
||||
os_setenv(name, val, 1);
|
||||
/*
|
||||
* When setting $VIMRUNTIME adjust the directory to find message
|
||||
* translations to $VIMRUNTIME/lang.
|
||||
*/
|
||||
if (*val != NUL && STRICMP(name, "VIMRUNTIME") == 0) {
|
||||
char_u *buf = concat_str(val, (char_u *)"/lang");
|
||||
bindtextdomain(VIMPACKAGE, (char *)buf);
|
||||
char *buf = (char *)concat_str((char_u *)val, (char_u *)"/lang");
|
||||
bindtextdomain(VIMPACKAGE, buf);
|
||||
xfree(buf);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user