From 2980d1fba97069805c3649c5d99d0356bce6c303 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 28 Aug 2012 22:12:05 -0400 Subject: [PATCH] prim_toPath: Actually make the string a path --- src/libexpr/primops.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 509297003..409e6256b 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -517,7 +517,9 @@ static void prim_toPath(EvalState & state, Value * * args, Value & v) { PathSet context; Path path = state.coerceToPath(*args[0], context); - mkString(v, canonPath(path), context); + if (!context.empty()) + throw EvalError(format("string `%1%' cannot refer to other paths") % path); + mkPath(v, canonPath(path).c_str()); }