about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorAlexander Ried <ried@mytum.de>2016-10-19T14·03+0200
committerAlexander Ried <ried@mytum.de>2016-10-19T14·03+0200
commitc935e8eeaf3ef5f49f66468ba551fd016fd76aa0 (patch)
tree82f738d0f167e84b01adf33ee0e92ad7167aae63 /src/libexpr/primops.cc
parentb05b98df7544d02387f583ca5434f33f3e9cb471 (diff)
fixup! replace own regex class with std::regex
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 4bf3f5a02707..5ba9830423b0 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -1635,7 +1635,10 @@ static void prim_match(EvalState & state, const Pos & pos, Value * * args, Value
     const size_t len = match.size() - 1;
     state.mkList(v, len);
     for (size_t i = 0; i < len; ++i) {
-        mkString(*(v.listElems()[i] = state.allocValue()), match[i + 1].str().c_str());
+        if (!match[i+1].matched)
+            mkNull(*(v.listElems()[i] = state.allocValue()));
+        else
+            mkString(*(v.listElems()[i] = state.allocValue()), match[i + 1].str().c_str());
     }
 }