From d7402c9cd5c17644d73b2a7a39e10be22fffeb00 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Mon, 13 Aug 2018 11:27:35 +0200 Subject: dirOf: allow use on non-absolute paths --- src/libutil/util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libutil') diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 6bc64ae75..4cc7455be 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -167,7 +167,7 @@ Path dirOf(const Path & path) { Path::size_type pos = path.rfind('/'); if (pos == string::npos) - throw Error(format("invalid file name '%1%'") % path); + return "."; return pos == 0 ? "/" : Path(path, 0, pos); } -- cgit v1.2.3