From: Chris Dams Date: Thu, 20 Apr 2006 20:10:52 +0000 (+0000) Subject: Fixed bug in ::match. X-Git-Tag: release_1-3-5~18 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=commitdiff_plain;h=2ad0a38fd07ab0d1775a8e4a0f9b1d46ee0ca553;p=ginac.git Fixed bug in ::match. --- diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp index 7555bd18..549d1f84 100644 --- a/ginac/expairseq.cpp +++ b/ginac/expairseq.cpp @@ -382,10 +382,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