diff options
Diffstat (limited to 'src/libutil/canon-path.cc')
-rw-r--r-- | src/libutil/canon-path.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libutil/canon-path.cc b/src/libutil/canon-path.cc index ddf6db6d1..040464532 100644 --- a/src/libutil/canon-path.cc +++ b/src/libutil/canon-path.cc @@ -13,6 +13,11 @@ CanonPath::CanonPath(std::string_view raw, const CanonPath & root) : path(absPath((Path) raw, root.abs())) { } +CanonPath CanonPath::fromCwd(std::string_view path) +{ + return CanonPath(unchecked_t(), absPath((Path) path)); +} + std::optional<CanonPath> CanonPath::parent() const { if (isRoot()) return std::nullopt; |