From 244e2db6a7cab8c7e1005dfef0e7c74953a237ea Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 17 May 2022 12:34:04 +0100 Subject: Always have a non-null fall-back PATH env Falls back to a reasonable /usr/bin --- icespider/compile/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icespider/compile/main.cpp b/icespider/compile/main.cpp index 2ea668c..cd50f15 100644 --- a/icespider/compile/main.cpp +++ b/icespider/compile/main.cpp @@ -23,7 +23,7 @@ defaultPostProcessor() constexpr std::array, 1> pps {{ {"clang-format", "-i"}, }}; - const std::string_view path {getenv("PATH")}; + const std::string_view path {getenv("PATH") ?: "/usr/bin"}; const auto pathBegin = make_split_iterator(path, first_finder(":", boost::is_equal())); for (const auto & [cmd, opts] : pps) { for (auto p = pathBegin; p != decltype(pathBegin) {}; ++p) { -- cgit v1.2.3