Remove char_u: vim_setenv()

This commit is contained in:
Mark Bainter
2015-04-12 21:26:06 +00:00
parent 4848158cc1
commit a4e51f72ab
5 changed files with 17 additions and 19 deletions

View File

@@ -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. */ /* We don't want $DIFF_OPTIONS to get in the way. */
if (os_getenv("DIFF_OPTIONS")) { 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 /* Build the diff command and execute it. Always use -a, binary

View File

@@ -1761,7 +1761,7 @@ ex_let_one (
} }
} }
if (p != NULL) { if (p != NULL) {
vim_setenv(name, p); vim_setenv((char *)name, (char *)p);
if (STRICMP(name, "HOME") == 0) if (STRICMP(name, "HOME") == 0)
init_homedir(); init_homedir();
else if (didset_vim && STRICMP(name, "VIM") == 0) else if (didset_vim && STRICMP(name, "VIM") == 0)

View File

@@ -3127,22 +3127,20 @@ void ex_language(exarg_T *eap)
++_nl_msg_cat_cntr; ++_nl_msg_cat_cntr;
#endif #endif
/* Reset $LC_ALL, otherwise it would overrule everything. */ /* Reset $LC_ALL, otherwise it would overrule everything. */
vim_setenv((char_u *)"LC_ALL", (char_u *)""); vim_setenv("LC_ALL", "");
if (what != LC_TIME) { if (what != LC_TIME) {
/* Tell gettext() what to translate to. It apparently doesn't /* Tell gettext() what to translate to. It apparently doesn't
* use the currently effective locale. */ * use the currently effective locale. */
if (what == LC_ALL) { if (what == LC_ALL) {
vim_setenv((char_u *)"LANG", name); vim_setenv("LANG", (char *)name);
/* Clear $LANGUAGE because GNU gettext uses it. */ /* Clear $LANGUAGE because GNU gettext uses it. */
vim_setenv((char_u *)"LANGUAGE", (char_u *)""); vim_setenv("LANGUAGE", "");
} }
if (what != LC_CTYPE) { if (what != LC_CTYPE) {
char_u *mname; vim_setenv("LC_MESSAGES", (char *)name);
mname = name; set_helplang_default((char *)name);
vim_setenv((char_u *)"LC_MESSAGES", mname);
set_helplang_default(mname);
} }
} }

View File

@@ -2288,7 +2288,7 @@ void set_init_3(void)
* When 'helplang' is still at its default value, set it to "lang". * When 'helplang' is still at its default value, set it to "lang".
* Only the first two characters of "lang" are used. * 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; int idx;
@@ -3644,11 +3644,11 @@ did_set_string_option (
else if (varp == &p_hf) { else if (varp == &p_hf) {
/* May compute new values for $VIM and $VIMRUNTIME */ /* May compute new values for $VIM and $VIMRUNTIME */
if (didset_vim) { if (didset_vim) {
vim_setenv((char_u *)"VIM", (char_u *)""); vim_setenv("VIM", "");
didset_vim = FALSE; didset_vim = FALSE;
} }
if (didset_vimruntime) { if (didset_vimruntime) {
vim_setenv((char_u *)"VIMRUNTIME", (char_u *)""); vim_setenv("VIMRUNTIME", "");
didset_vimruntime = FALSE; didset_vimruntime = FALSE;
} }
} }
@@ -7437,7 +7437,7 @@ void vimrc_found(char_u *fname, char_u *envname)
/* Set $MYVIMRC to the first vimrc file found. */ /* Set $MYVIMRC to the first vimrc file found. */
p = FullName_save(fname, FALSE); p = FullName_save(fname, FALSE);
if (p != NULL) { if (p != NULL) {
vim_setenv(envname, p); vim_setenv((char *)envname, (char *)p);
xfree(p); xfree(p);
} }
} else if (dofree) } else if (dofree)

View File

@@ -528,10 +528,10 @@ char *vim_getenv(const char *name, bool *mustfree)
*/ */
if (p != NULL) { if (p != NULL) {
if (vimruntime) { if (vimruntime) {
vim_setenv((char_u *)"VIMRUNTIME", (char_u *)p); vim_setenv("VIMRUNTIME", p);
didset_vimruntime = true; didset_vimruntime = true;
} else { } else {
vim_setenv((char_u *)"VIM", (char_u *)p); vim_setenv("VIM", p);
didset_vim = true; 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. /// Our portable version of setenv.
/// Has special handling for $VIMRUNTIME to keep the localization machinery /// Has special handling for $VIMRUNTIME to keep the localization machinery
/// sane. /// 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 * When setting $VIMRUNTIME adjust the directory to find message
* translations to $VIMRUNTIME/lang. * translations to $VIMRUNTIME/lang.
*/ */
if (*val != NUL && STRICMP(name, "VIMRUNTIME") == 0) { if (*val != NUL && STRICMP(name, "VIMRUNTIME") == 0) {
char_u *buf = concat_str(val, (char_u *)"/lang"); char *buf = (char *)concat_str((char_u *)val, (char_u *)"/lang");
bindtextdomain(VIMPACKAGE, (char *)buf); bindtextdomain(VIMPACKAGE, buf);
xfree(buf); xfree(buf);
} }
} }