aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-12-23 15:32:54 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-12-23 15:32:54 +0100
commit64c60f7241217cf4ba652f6502935ac7d523fb55 (patch)
tree4fe6fe84163a29e3be131289f56555a4a367c708
parent17373debe99396449534391aa26fe5f5eef74ce9 (diff)
Fix CanonPath::dirOf() returning a string_view of a temporary
https://hydra.nixos.org/build/202837872
-rw-r--r--src/libutil/canon-path.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/canon-path.hh b/src/libutil/canon-path.hh
index c5e7f0596..9d5984584 100644
--- a/src/libutil/canon-path.hh
+++ b/src/libutil/canon-path.hh
@@ -110,7 +110,7 @@ public:
std::optional<std::string_view> dirOf() const
{
if (isRoot()) return std::nullopt;
- return path.substr(0, path.rfind('/'));
+ return ((std::string_view) path).substr(0, path.rfind('/'));
}
std::optional<std::string_view> baseName() const