From 9d1fb3c9ffc17ab464f79e548cfad65aebe6d79d Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Tue, 9 Mar 2004 18:09:45 +0000 Subject: [PATCH] fixing the fix [SVN r22463] --- include/boost/algorithm/string/detail/finder.hpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/include/boost/algorithm/string/detail/finder.hpp b/include/boost/algorithm/string/detail/finder.hpp index 8be82f1..5229cde 100644 --- a/include/boost/algorithm/string/detail/finder.hpp +++ b/include/boost/algorithm/string/detail/finder.hpp @@ -325,14 +325,10 @@ namespace boost { typedef ForwardIteratorT input_iterator_type; typedef iterator_range result_type; - if(std::distance(Begin,End) >= m_N) - { - return result_type(Begin,End); - } - else - { - return result_type(Begin,Begin+m_N); - } + if ( (End<=Begin) || (End < (Begin+m_N) ) ) + return result_type( Begin, End ); + + return result_type(Begin,Begin+m_N); } private: