From: Chris Dams Date: Thu, 20 Apr 2006 20:08:06 +0000 (+0000) Subject: Fixed bug in ::match. X-Git-Tag: release_1-4-0~95 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=73f0ce4cf8d91f073f35a45443f5fbe886921c5c Fixed bug in ::match. --- 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