diff --git a/icu4c/source/i18n/usearch.cpp b/icu4c/source/i18n/usearch.cpp index a6dcba1315e..7d06daa2e07 100644 --- a/icu4c/source/i18n/usearch.cpp +++ b/icu4c/source/i18n/usearch.cpp @@ -4041,9 +4041,9 @@ U_CAPI UBool U_EXPORT2 usearch_search(UStringSearch *strsrch, mLimit = minLimit; } else { int32_t nba = nextBoundaryAfter(strsrch, minLimit); - // Note that we can have nba < maxLimit, in which case we want to set - // mLimit to nba regardless of allowMidclusterMatch (i.e. we back off - // mLimit to the previous breakIterator boundary). + // Note that we can have nba < maxLimit && nba >= minLImit, in which + // case we want to set mLimit to nba regardless of allowMidclusterMatch + // (i.e. we back off mLimit to the previous breakIterator boundary). if (nba >= lastCEI->highIndex && (!allowMidclusterMatch || nba < maxLimit)) { mLimit = nba; } @@ -4311,9 +4311,9 @@ U_CAPI UBool U_EXPORT2 usearch_searchBackwards(UStringSearch *strsrch, // This advances the index over any combining characters. if (minLimit < maxLimit) { int32_t nba = nextBoundaryAfter(strsrch, minLimit); - // Note that we can have nba < maxLimit, in which case we want to set - // mLimit to nba regardless of allowMidclusterMatch (i.e. we back off - // mLimit to the previous breakIterator boundary). + // Note that we can have nba < maxLimit && nba >= minLImit, in which + // case we want to set mLimit to nba regardless of allowMidclusterMatch + // (i.e. we back off mLimit to the previous breakIterator boundary). if (nba >= lastCEI->highIndex && (!allowMidclusterMatch || nba < maxLimit)) { mLimit = nba; } diff --git a/icu4c/source/test/cintltst/usrchdat.c b/icu4c/source/test/cintltst/usrchdat.c index 433584daf44..e9864a3bad5 100644 --- a/icu4c/source/test/cintltst/usrchdat.c +++ b/icu4c/source/test/cintltst/usrchdat.c @@ -754,7 +754,7 @@ static const SearchData DIACRITICMATCH[] = { {NULL, NULL, NULL, UCOL_TERTIARY, USEARCH_STANDARD_ELEMENT_COMPARISON, NULL, {-1}, {0}} }; -static const SearchData INDICPREFIXMATCH[] = { // +static const SearchData INDICPREFIXMATCH[] = { {"\\u0915\\u0020\\u0915\\u0901\\u0020\\u0915\\u0902\\u0020\\u0915\\u0903\\u0020\\u0915\\u0940\\u0020\\u0915\\u093F\\u0020\\u0915\\u0943\\u0020\\u0915\\u093C\\u0020\\u0958", "\\u0915", NULL, UCOL_PRIMARY, USEARCH_STANDARD_ELEMENT_COMPARISON, NULL, {0, 2, 5, 8, 11, 14, 17, 20, 23,-1}, {1, 2, 2, 2, 1, 1, 1, 2, 1}}, {"\\u0915\\u0924\\u0020\\u0915\\u0924\\u0940\\u0020\\u0915\\u0924\\u093F\\u0020\\u0915\\u0924\\u0947\\u0020\\u0915\\u0943\\u0924\\u0020\\u0915\\u0943\\u0924\\u0947", diff --git a/icu4c/source/test/cintltst/usrchtst.c b/icu4c/source/test/cintltst/usrchtst.c index acd9b057c4f..7e95f98bd7a 100644 --- a/icu4c/source/test/cintltst/usrchtst.c +++ b/icu4c/source/test/cintltst/usrchtst.c @@ -2987,7 +2987,7 @@ static void TestMatchFollowedByIgnorables(void) { ucol_close(coll); } -static void TestIndicPrefixMatch(void) // +static void TestIndicPrefixMatch(void) { int count = 0; UErrorCode status = U_ZERO_ERROR;