From fb0648940700ddeec3bda2329d73a39553aeee72 Mon Sep 17 00:00:00 2001 From: Eric Mader Date: Fri, 23 May 2008 18:35:24 +0000 Subject: [PATCH] ICU-5420 Return [0, 0] in SimpleSearch if there are no CEs in the pattern. X-SVN-Rev: 23979 --- icu4c/source/test/intltest/ssearch.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/icu4c/source/test/intltest/ssearch.cpp b/icu4c/source/test/intltest/ssearch.cpp index b5aca5fc06..ef99294c8d 100644 --- a/icu4c/source/test/intltest/ssearch.cpp +++ b/icu4c/source/test/intltest/ssearch.cpp @@ -1366,6 +1366,11 @@ static UBool simpleSearch(UCollator *coll, const UnicodeString &target, int32_t UBreakIterator *charBreakIterator = ubrk_open(UBRK_CHARACTER, ucol_getLocale(coll, ULOC_VALID_LOCALE, &status), target.getBuffer(), target.length(), &status); + if (patternSize == 0) { + matchStart = matchEnd = 0; + return FALSE; + } + matchStart = matchEnd = -1; for(int32_t i = 0; i < targetSize; i += 1) {