aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/os/env.c')
-rw-r--r--src/nvim/os/env.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 4e6a52a78e..c03fd60f03 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -529,9 +529,9 @@ void free_homedir(void)
/// again soon.
/// @param src String containing environment variables to expand
/// @see {expand_env}
-char_u *expand_env_save(char_u *src)
+char *expand_env_save(char *src)
{
- return expand_env_save_opt(src, false);
+ return (char *)expand_env_save_opt((char_u *)src, false);
}
/// Similar to expand_env_save() but when "one" is `true` handle the string as
@@ -644,7 +644,7 @@ void expand_env_esc(char_u *restrict srcp, char_u *restrict dst, int dstlen, boo
#endif
} else if (src[1] == NUL // home directory
|| vim_ispathsep(src[1])
- || vim_strchr((char_u *)" ,\t\n", src[1]) != NULL) {
+ || vim_strchr(" ,\t\n", src[1]) != NULL) {
var = (char_u *)homedir;
tail = src + 1;
} else { // user directory
@@ -884,11 +884,10 @@ void vim_get_prefix_from_exepath(char *exe_name)
{
// TODO(bfredl): param could have been written as "char exe_name[MAXPATHL]"
// but c_grammar.lua does not recognize it (yet).
- xstrlcpy(exe_name, (char *)get_vim_var_str(VV_PROGPATH),
- MAXPATHL * sizeof(*exe_name));
+ xstrlcpy(exe_name, get_vim_var_str(VV_PROGPATH), MAXPATHL * sizeof(*exe_name));
char *path_end = (char *)path_tail_with_sep((char_u *)exe_name);
*path_end = '\0'; // remove the trailing "nvim.exe"
- path_end = (char *)path_tail((char_u *)exe_name);
+ path_end = path_tail(exe_name);
*path_end = '\0'; // remove the trailing "bin/"
}
@@ -940,7 +939,7 @@ char *vim_getenv(const char *name)
// - the directory name from 'helpfile' (unless it contains '$')
// - the executable name from argv[0]
if (vim_path == NULL) {
- if (p_hf != NULL && vim_strchr(p_hf, '$') == NULL) {
+ if (p_hf != NULL && vim_strchr((char *)p_hf, '$') == NULL) {
vim_path = (char *)p_hf;
}
@@ -957,7 +956,7 @@ char *vim_getenv(const char *name)
if (vim_path != NULL) {
// remove the file name
- char *vim_path_end = (char *)path_tail((char_u *)vim_path);
+ char *vim_path_end = path_tail(vim_path);
// remove "doc/" from 'helpfile', if present
if (vim_path == (char *)p_hf) {
@@ -1048,7 +1047,7 @@ size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst
}
if (buf != NULL && buf->b_help) {
- const size_t dlen = STRLCPY(dst, path_tail(src), dstlen);
+ const size_t dlen = STRLCPY(dst, path_tail((char *)src), dstlen);
return MIN(dlen, dstlen - 1);
}
@@ -1158,7 +1157,7 @@ char_u *home_replace_save(buf_T *buf, char_u *src) FUNC_ATTR_NONNULL_RET
/// Function given to ExpandGeneric() to obtain an environment variable name.
-char_u *get_env_name(expand_T *xp, int idx)
+char *get_env_name(expand_T *xp, int idx)
{
#define ENVNAMELEN 100
// this static buffer is needed to avoid a memory leak in ExpandGeneric
@@ -1168,7 +1167,7 @@ char_u *get_env_name(expand_T *xp, int idx)
if (envname) {
STRLCPY(name, envname, ENVNAMELEN);
xfree(envname);
- return name;
+ return (char *)name;
}
return NULL;
}
@@ -1226,10 +1225,10 @@ bool os_shell_is_cmdexe(const char *sh)
}
if (striequal(sh, "$COMSPEC")) {
const char *comspec = os_getenv("COMSPEC");
- return striequal("cmd.exe", (char *)path_tail((char_u *)comspec));
+ return striequal("cmd.exe", path_tail(comspec));
}
if (striequal(sh, "cmd.exe") || striequal(sh, "cmd")) {
return true;
}
- return striequal("cmd.exe", (char *)path_tail((char_u *)sh));
+ return striequal("cmd.exe", path_tail(sh));
}