diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-07-21 16:44:15 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-07-21 20:51:37 +0200 |
commit | 1fde79eedf0091af1b04ce3d91045672cb3c233e (patch) | |
tree | 365f8c6e17b593e5350bdd927ecf237363724de4 /src/nvim/os/fs.c | |
parent | b08dc3ec195feb4ab69c898ab816c104d2aa1aa1 (diff) | |
download | rneovim-1fde79eedf0091af1b04ce3d91045672cb3c233e.tar.gz rneovim-1fde79eedf0091af1b04ce3d91045672cb3c233e.tar.bz2 rneovim-1fde79eedf0091af1b04ce3d91045672cb3c233e.zip |
os_can_exe: remove char_u
Diffstat (limited to 'src/nvim/os/fs.c')
-rw-r--r-- | src/nvim/os/fs.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index f34592d107..57a864b7ec 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -239,10 +239,10 @@ int os_exepath(char *buffer, size_t *size) /// - is absolute. /// /// @return `false` otherwise. -bool os_can_exe(const char_u *name, char_u **abspath, bool use_path) +bool os_can_exe(const char *name, char **abspath, bool use_path) FUNC_ATTR_NONNULL_ARG(1) { - bool no_path = !use_path || path_is_absolute(name); + bool no_path = !use_path || path_is_absolute((char_u *)name); // If the filename is "qualified" (relative or absolute) do not check $PATH. #ifdef WIN32 no_path |= (name[0] == '.' @@ -255,11 +255,11 @@ bool os_can_exe(const char_u *name, char_u **abspath, bool use_path) if (no_path) { #ifdef WIN32 - if (is_executable_ext((char *)name, abspath)) { + if (is_executable_ext(name, abspath)) { #else // Must have path separator, cannot execute files in the current directory. - if ((const char_u *)gettail_dir((const char *)name) != name - && is_executable((char *)name, abspath)) { + if (gettail_dir(name) != name + && is_executable(name, abspath)) { #endif return true; } else { @@ -274,10 +274,10 @@ bool os_can_exe(const char_u *name, char_u **abspath, bool use_path) /// /// @param[in] name Filename to check. /// @param[out,allocated] abspath Returns full exe path, if not NULL. -static bool is_executable(const char *name, char_u **abspath) +static bool is_executable(const char *name, char **abspath) FUNC_ATTR_NONNULL_ARG(1) { - int32_t mode = os_getperm((const char *)name); + int32_t mode = os_getperm(name); if (mode < 0) { return false; @@ -295,7 +295,7 @@ static bool is_executable(const char *name, char_u **abspath) const bool ok = (r == 0); #endif if (ok && abspath != NULL) { - *abspath = save_abs_path((char_u *)name); + *abspath = save_abs_path(name); } return ok; } @@ -304,7 +304,7 @@ static bool is_executable(const char *name, char_u **abspath) /// Checks if file `name` is executable under any of these conditions: /// - extension is in $PATHEXT and `name` is executable /// - result of any $PATHEXT extension appended to `name` is executable -static bool is_executable_ext(char *name, char_u **abspath) +static bool is_executable_ext(char *name, char **abspath) FUNC_ATTR_NONNULL_ARG(1) { const bool is_unix_shell = strstr((char *)path_tail(p_sh), "sh") != NULL; @@ -356,7 +356,7 @@ static bool is_executable_ext(char *name, char_u **abspath) /// @param[out] abspath Returns resolved executable path, if not NULL. /// /// @return `true` if `name` is an executable inside `$PATH`. -static bool is_executable_in_path(const char_u *name, char_u **abspath) +static bool is_executable_in_path(const char *name, char **abspath) FUNC_ATTR_NONNULL_ARG(1) { const char *path_env = os_getenv("PATH"); @@ -373,7 +373,7 @@ static bool is_executable_in_path(const char_u *name, char_u **abspath) char *path = xstrdup(path_env); #endif - size_t buf_len = STRLEN(name) + strlen(path) + 2; + size_t buf_len = strlen(name) + strlen(path) + 2; char *buf = xmalloc(buf_len); // Walk through all entries in $PATH to check if "name" exists there and @@ -385,7 +385,7 @@ static bool is_executable_in_path(const char_u *name, char_u **abspath) // Combine the $PATH segment with `name`. STRLCPY(buf, p, e - p + 1); - append_path(buf, (char *)name, buf_len); + append_path(buf, name, buf_len); #ifdef WIN32 if (is_executable_ext(buf, abspath)) { |