From kde-commits Fri Mar 21 22:14:31 2008 From: Harri Porten Date: Fri, 21 Mar 2008 22:14:31 +0000 To: kde-commits Subject: branches/KDE/4.0/kdelibs/khtml/xml Message-Id: <1206137671.871718.21531.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120613768003590 SVN commit 788596 by porten: Take a shortcut if we reach the end of the range. Fixes an off-by-one bug found by Acid3 but the code looks like it can be simplified a lot. M +2 -0 dom2_rangeimpl.cpp --- branches/KDE/4.0/kdelibs/khtml/xml/dom2_rangeimpl.cpp #788595:788596 @@ -881,6 +881,8 @@ } while(n) { + if(n == m_endContainer && m_endOffset == 0) + break; if(n->nodeType() == DOM::Node::TEXT_NODE || n->nodeType() == DOM::Node::CDATA_SECTION_NODE) {