From c7ac4449113218adac32853ef150a76bb318dbac Mon Sep 17 00:00:00 2001 From: Carlos Espa <43477095+Ceres6@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:15:46 +0000 Subject: [PATCH] fix: ci errors --- src/permission/fs_permission.cc | 2 +- src/util.cc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/permission/fs_permission.cc b/src/permission/fs_permission.cc index 14e8c9e2251538..183bd39f43de18 100644 --- a/src/permission/fs_permission.cc +++ b/src/permission/fs_permission.cc @@ -131,7 +131,7 @@ void FSPermission::Apply(Environment* env, } return; } - GrantAccess(scope, PathResolve(env, { res })); + GrantAccess(scope, PathResolve(env, {res})); } } diff --git a/src/util.cc b/src/util.cc index 14596a3602bc30..c890c2164cd89b 100644 --- a/src/util.cc +++ b/src/util.cc @@ -785,7 +785,7 @@ std::string NormalizeString(const std::string_view path, } #ifdef _WIN32 -bool IsWindowsDeviceRoot(const char c) const noexcept { +bool IsWindowsDeviceRoot(const char c) noexcept { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } @@ -933,9 +933,11 @@ std::string PathResolve(Environment* env, std::string resolvedPath; bool resolvedAbsolute = false; auto cwd = env->GetCwd(env->exec_path()); + const size_t numArgs = paths.size(); for (int i = numArgs - 1; i >= -1 && !resolvedAbsolute; i--) { - const std::string& path = (i >= 0) ? std::string(paths[i]) : env->GetCwd(env->exec_path()); + const std::string& path = + (i >= 0) ? std::string(paths[i]) : env->GetCwd(env->exec_path()); /* validateString(path, "paths[" + std::to_string(i) + "]"); */ if (!path.empty()) {