From c935e8eeaf3ef5f49f66468ba551fd016fd76aa0 Mon Sep 17 00:00:00 2001 From: Alexander Ried Date: Wed, 19 Oct 2016 16:03:53 +0200 Subject: [PATCH] fixup! replace own regex class with std::regex --- src/libexpr/primops.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()); } }