diff options
author | Alexander Ried <ried@mytum.de> | 2016-10-19 16:03:53 +0200 |
---|---|---|
committer | Alexander Ried <ried@mytum.de> | 2016-10-19 16:03:53 +0200 |
commit | c935e8eeaf3ef5f49f66468ba551fd016fd76aa0 (patch) | |
tree | 82f738d0f167e84b01adf33ee0e92ad7167aae63 /src/libexpr | |
parent | b05b98df7544d02387f583ca5434f33f3e9cb471 (diff) |
fixup! replace own regex class with std::regex
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/primops.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 4bf3f5a02..5ba983042 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()); } } |