From 0f3da69467809227254c2a33eb3ec27696c70882 Mon Sep 17 00:00:00 2001 From: Syn Wee Quek Date: Tue, 8 Jul 2003 02:02:17 +0000 Subject: [PATCH] ICU-3077 canonical search performed for full set of accents now. also added more detailed out-of-bounds checks X-SVN-Rev: 12602 --- icu4c/source/i18n/stsearch.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/icu4c/source/i18n/stsearch.cpp b/icu4c/source/i18n/stsearch.cpp index a19e9394384..a717b1765c7 100644 --- a/icu4c/source/i18n/stsearch.cpp +++ b/icu4c/source/i18n/stsearch.cpp @@ -364,6 +364,16 @@ int32_t StringSearch::handleNext(int32_t position, UErrorCode &status) setMatchNotFound(); return USEARCH_DONE; } + if (m_search_->matchedLength <= 0) { + // the flipping direction issue has already been handled + // in next() + // for boundary check purposes. this will ensure that the + // next match will not preceed the current offset + // note search->matchedIndex will always be set to something + // in the code + m_search_->matchedIndex = position - 1; + } + ucol_setOffset(m_strsrch_->textIter, position, &status); while (TRUE) { if (m_search_->isCanonicalMatch) {