paths: add a better error message for posix expansion

This commit is contained in:
Danny Robson 2020-04-21 11:40:30 +10:00
parent baf5c99cfa
commit 1f25f780ee

View File

@ -25,7 +25,7 @@ cruft::paths::expand (std::filesystem::path const &val)
std::unique_ptr<wordexp_t, decltype(&wordfree)> cleanup {&words, &wordfree};
if (words.we_wordc != 1)
throw std::runtime_error ("glob matches too many files");
throw std::runtime_error ("path expansion is not singular");
CHECK_EQ (words.we_offs, 0u);
return words.we_wordv[0];