From: Joel Rosdahl Date: Wed, 2 Aug 2023 11:01:38 +0000 (+0200) Subject: refactor: fs::path-ify is_ccache_executable X-Git-Tag: v4.9~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6ac29e8a272f9916c66bd7897fc103c47899efd;p=thirdparty%2Fccache.git refactor: fs::path-ify is_ccache_executable --- diff --git a/src/ccache.cpp b/src/ccache.cpp index 904dca388..705878fd2 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -2668,9 +2668,9 @@ do_cache_compilation(Context& ctx) } bool -is_ccache_executable(const std::string_view path) +is_ccache_executable(const fs::path& path) { - std::string name(Util::base_name(path)); + std::string name = path.filename().string(); #ifdef _WIN32 name = util::to_lowercase(name); #endif diff --git a/src/ccache.hpp b/src/ccache.hpp index 3d8072e6f..7fe12359a 100644 --- a/src/ccache.hpp +++ b/src/ccache.hpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -52,4 +53,4 @@ void find_compiler(Context& ctx, const FindExecutableFunction& find_executable_function, bool masquerading_as_compiler); CompilerType guess_compiler(std::string_view path); -bool is_ccache_executable(std::string_view path); +bool is_ccache_executable(const std::filesystem::path& path);