about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libexpr/eval.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 49aeb0036863..8c8bb219bdb5 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -804,9 +804,12 @@ string EvalState::coerceToString(Value & v, PathSet & context,
         if (v.type == tList) {
             string result;
             for (unsigned int n = 0; n < v.list.length; ++n) {
-                if (n) result += " ";
                 result += coerceToString(v.list.elems[n],
                     context, coerceMore, copyToStore);
+                if (n < v.list.length - 1
+                    /* !!! not quite correct */
+                    && (v.list.elems[n].type != tList || v.list.elems[n].list.length != 0))
+                    result += " ";
             }
             return result;
         }