paths: add a better error message for posix expansion
This commit is contained in:
parent
baf5c99cfa
commit
1f25f780ee
@ -25,7 +25,7 @@ cruft::paths::expand (std::filesystem::path const &val)
|
|||||||
std::unique_ptr<wordexp_t, decltype(&wordfree)> cleanup {&words, &wordfree};
|
std::unique_ptr<wordexp_t, decltype(&wordfree)> cleanup {&words, &wordfree};
|
||||||
|
|
||||||
if (words.we_wordc != 1)
|
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);
|
CHECK_EQ (words.we_offs, 0u);
|
||||||
return words.we_wordv[0];
|
return words.we_wordv[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user