From 17b57411f4c699350055b0f63258217cc7301dca Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sun, 14 Jan 2024 10:36:10 +0100 Subject: [PATCH] refactor: fs::path-ify util::is_dev_null_path (cherry picked from commit 470302017003ab3d831026ae092aeb1fee8ecf5d) --- src/util/path.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/path.hpp b/src/util/path.hpp index 5a29a2d6f..cb8e04978 100644 --- a/src/util/path.hpp +++ b/src/util/path.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2023 Joel Rosdahl and other contributors +// Copyright (C) 2021-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -45,7 +45,7 @@ std::string apparent_cwd(const std::string& actual_cwd); const char* get_dev_null_path(); // Return whether `path` is /dev/null or (on Windows) NUL. -bool is_dev_null_path(std::string_view path); +bool is_dev_null_path(const std::filesystem::path& path); // Return whether `path` includes at least one directory separator. bool is_full_path(std::string_view path); @@ -61,11 +61,11 @@ std::string real_path(std::string_view path); // --- Inline implementations --- inline bool -is_dev_null_path(const std::string_view path) +is_dev_null_path(const std::filesystem::path& path) { return path == "/dev/null" #ifdef _WIN32 - || util::to_lowercase(path) == "nul" + || util::to_lowercase(path.string()) == "nul" #endif ; } -- 2.47.2