about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index d4a83cafe4fe..7dddc91a86ab 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -256,7 +256,12 @@ static Expr prim_getEnv(EvalState & state, const ATermVector & args)
 static Expr prim_trace(EvalState & state, const ATermVector & args)
 {
     Expr e = evalExpr(state, args[0]);
-    printMsg(lvlError, format("trace: %1%") % e);
+    string s;
+    PathSet context;
+    if (matchStr(e, s, context))
+        printMsg(lvlError, format("trace: %1%") % s);
+    else
+        printMsg(lvlError, format("trace: %1%") % e);
     return evalExpr(state, args[1]);
 }