aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/diff.c2
-rw-r--r--src/nvim/eval.c2
-rw-r--r--src/nvim/ex_cmds2.c12
-rw-r--r--src/nvim/option.c8
-rw-r--r--src/nvim/os/env.c12
5 files changed, 17 insertions, 19 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 937baad648..88d63b3383 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -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
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 58d646cd3b..405b2b1e98 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -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)
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 463cc794c7..848daf023f 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -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);
}
}
diff --git a/src/nvim/option.c b/src/nvim/option.c
index f6c613ef6a..6da0058c1a 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -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)
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 0378b393b1..e996bdfc49 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -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);
}
}