aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorDundar Göc <gocdundar@gmail.com>2022-08-26 23:11:25 +0200
committerdundargoc <gocdundar@gmail.com>2022-08-31 13:47:18 +0200
commitfb1edb2f5728d74ae811c6ab32395598cea5609b (patch)
treeb476bb9c23a02167dd74f0da65343993f134c2b8 /src/nvim/path.c
parent0903702634d8e5714749ea599a2f1042b3377525 (diff)
downloadrneovim-fb1edb2f5728d74ae811c6ab32395598cea5609b.tar.gz
rneovim-fb1edb2f5728d74ae811c6ab32395598cea5609b.tar.bz2
rneovim-fb1edb2f5728d74ae811c6ab32395598cea5609b.zip
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index a5cec6772f..5bbcbc7144 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -755,8 +755,9 @@ static size_t do_path_expand(garray_T *gap, const char_u *path, size_t wildoff,
backslash_halve((char *)buf + len + 1);
}
// add existing file or symbolic link
- if ((flags & EW_ALLLINKS) ? os_fileinfo_link((char *)buf, &file_info)
- : os_path_exists(buf)) {
+ if ((flags & EW_ALLLINKS)
+ ? os_fileinfo_link((char *)buf, &file_info)
+ : os_path_exists((char *)buf)) {
addfile(gap, buf, flags);
}
}
@@ -1461,7 +1462,7 @@ void addfile(garray_T *gap, char_u *f, int flags)
if (!(flags & EW_NOTFOUND)
&& ((flags & EW_ALLLINKS)
? !os_fileinfo_link((char *)f, &file_info)
- : !os_path_exists(f))) {
+ : !os_path_exists((char *)f))) {
return;
}
@@ -1926,7 +1927,7 @@ void path_fix_case(char *name)
while ((entry = (char *)os_scandir_next(&dir))) {
// Only accept names that differ in case and are the same byte
// length. TODO: accept different length name.
- if (STRICMP(tail, entry) == 0 && STRLEN(tail) == STRLEN(entry)) {
+ if (STRICMP(tail, entry) == 0 && strlen(tail) == strlen(entry)) {
char_u newname[MAXPATHL + 1];
// Verify the inode is equal.
@@ -1951,7 +1952,7 @@ void path_fix_case(char *name)
int after_pathsep(const char *b, const char *p)
{
return p > b && vim_ispathsep(p[-1])
- && utf_head_off((char_u *)b, (char_u *)p - 1) == 0;
+ && utf_head_off(b, p - 1) == 0;
}
/// Return true if file names "f1" and "f2" are in the same directory.
@@ -2272,7 +2273,7 @@ int path_full_dir_name(char *directory, char *buffer, size_t len)
int SUCCESS = 0;
int retval = OK;
- if (STRLEN(directory) == 0) {
+ if (strlen(directory) == 0) {
return os_dirname((char_u *)buffer, len);
}