From 2f42383fcd4341c23840ba36447ac0d5663aba47 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 14 Apr 2018 23:33:42 +0200 Subject: [PATCH] fixes --- ostd/path.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ostd/path.hh b/ostd/path.hh index 02b432c..cef3cef 100644 --- a/ostd/path.hh +++ b/ostd/path.hh @@ -145,7 +145,8 @@ struct path { std::string root() const { if (has_root()) { - return std::string{1, separator()}; + char sep = separator(); + return std::string{&sep, 1}; } return ""; } @@ -248,6 +249,9 @@ struct path { } path relative_to(path other) const { + if (other.p_path == ".") { + return *this; + } if (other.p_fmt != p_fmt) { other = path{other, p_fmt}; }