aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-01-17 14:17:40 +0100
committerGitHub <noreply@github.com>2023-01-17 21:17:40 +0800
commit0344bfad0fc87d2e256ea2b80de7abd069ba1dd2 (patch)
treee42d0318ed1e684bbb468661d8a1fbfe82e819ee /src/nvim/os
parent99186508d9a1b7536441112f9bbe48690592b5d7 (diff)
downloadrneovim-0344bfad0fc87d2e256ea2b80de7abd069ba1dd2.tar.gz
rneovim-0344bfad0fc87d2e256ea2b80de7abd069ba1dd2.tar.bz2
rneovim-0344bfad0fc87d2e256ea2b80de7abd069ba1dd2.zip
refactor: replace char_u with char 22 (#21786)
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/env.c4
-rw-r--r--src/nvim/os/fs.c7
-rw-r--r--src/nvim/os/shell.c6
3 files changed, 8 insertions, 9 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index e1db7a8ef7..ae34a79365 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -656,7 +656,7 @@ void expand_env_esc(char *restrict srcp, char *restrict dst, int dstlen, bool es
#endif
} else if (src[1] == NUL // home directory
|| vim_ispathsep(src[1])
- || vim_strchr(" ,\t\n", src[1]) != NULL) {
+ || vim_strchr(" ,\t\n", (uint8_t)src[1]) != NULL) {
var = homedir;
tail = src + 1;
} else { // user directory
@@ -1198,7 +1198,7 @@ bool os_setenv_append_path(const char *fname)
// No prescribed maximum on unix.
# define MAX_ENVPATHLEN INT_MAX
#endif
- if (!path_is_absolute((char_u *)fname)) {
+ if (!path_is_absolute(fname)) {
internal_error("os_setenv_append_path()");
return false;
}
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index 98ec9aa826..ce1b2d1cf5 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -914,12 +914,11 @@ int os_file_is_writable(const char *name)
/// Rename a file or directory.
///
/// @return `OK` for success, `FAIL` for failure.
-int os_rename(const char_u *path, const char_u *new_path)
+int os_rename(const char *path, const char *new_path)
FUNC_ATTR_NONNULL_ALL
{
int r;
- RUN_UV_FS_FUNC(r, uv_fs_rename, (const char *)path, (const char *)new_path,
- NULL);
+ RUN_UV_FS_FUNC(r, uv_fs_rename, path, new_path, NULL);
return (r == kLibuvSuccess ? OK : FAIL);
}
@@ -1382,7 +1381,7 @@ bool os_is_reparse_point_include(const char *path)
}
p = utf16_path;
- if (isalpha(p[0]) && p[1] == L':' && IS_PATH_SEP(p[2])) {
+ if (isalpha((uint8_t)p[0]) && p[1] == L':' && IS_PATH_SEP(p[2])) {
p += 3;
} else if (IS_PATH_SEP(p[0]) && IS_PATH_SEP(p[1])) {
p += 2;
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index 8177f06c64..ac8a141bbe 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -221,7 +221,7 @@ int os_expand_wildcards(int num_pat, char **pat, int *num_file, char ***file, in
// "command" below.
len++; // add space
for (j = 0; pat[i][j] != NUL; j++) {
- if (vim_strchr(SHELL_SPECIAL, pat[i][j]) != NULL) {
+ if (vim_strchr(SHELL_SPECIAL, (uint8_t)pat[i][j]) != NULL) {
len++; // may add a backslash
}
len++;
@@ -304,14 +304,14 @@ int os_expand_wildcards(int num_pat, char **pat, int *num_file, char ***file, in
// backslash inside backticks, before a special character
// and before a backtick.
if (intick
- || vim_strchr(SHELL_SPECIAL, pat[i][j + 1]) != NULL
+ || vim_strchr(SHELL_SPECIAL, (uint8_t)pat[i][j + 1]) != NULL
|| pat[i][j + 1] == '`') {
*p++ = '\\';
}
j++;
} else if (!intick
&& ((flags & EW_KEEPDOLLAR) == 0 || pat[i][j] != '$')
- && vim_strchr(SHELL_SPECIAL, pat[i][j]) != NULL) {
+ && vim_strchr(SHELL_SPECIAL, (uint8_t)pat[i][j]) != NULL) {
// Put a backslash before a special character, but not
// when inside ``. And not for $var when EW_KEEPDOLLAR is
// set.