From 73f0ce4cf8d91f073f35a45443f5fbe886921c5c Mon Sep 17 00:00:00 2001 From: Chris Dams Date: Thu, 20 Apr 2006 20:08:06 +0000 Subject: [PATCH] Fixed bug in ::match. --- ginac/expairseq.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp index 5652d89c..9d72a787 100644 --- a/ginac/expairseq.cpp +++ b/ginac/expairseq.cpp @@ -395,10 +395,20 @@ bool expairseq::match(const ex & pattern, lst & repl_lst) const continue; exvector::iterator it = ops.begin(), itend = ops.end(); while (it != itend) { + lst::const_iterator last_el = repl_lst.end(); + --last_el; if (it->match(p, repl_lst)) { ops.erase(it); goto found; } + while(true) { + lst::const_iterator next_el = last_el; + ++next_el; + if(next_el == repl_lst.end()) + break; + else + repl_lst.remove_last(); + } ++it; } return false; // no match found -- 2.44.0