diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-05-17 12:34:04 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-05-17 12:34:09 +0100 |
commit | 244e2db6a7cab8c7e1005dfef0e7c74953a237ea (patch) | |
tree | 12d1433b454378d8c49ef8ea6c2f4951e4f5a9e8 | |
parent | Work around weird GCC 11.3 error const-expr copying an optional (diff) | |
download | icespider-244e2db6a7cab8c7e1005dfef0e7c74953a237ea.tar.bz2 icespider-244e2db6a7cab8c7e1005dfef0e7c74953a237ea.tar.xz icespider-244e2db6a7cab8c7e1005dfef0e7c74953a237ea.zip |
Always have a non-null fall-back PATH env
Falls back to a reasonable /usr/bin
-rw-r--r-- | icespider/compile/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<const std::pair<std::string_view, std::string_view>, 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) { |