ICU-5420 Return [0, 0] in SimpleSearch if there are no CEs in the pattern.

X-SVN-Rev: 23979
This commit is contained in:
Eric Mader 2008-05-23 18:35:24 +00:00
parent 98f14bc209
commit fb06489407

View File

@ -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) {