ICU-4045 regexp::find(), fix incorrect resut when called repeatedly at end of input string.

X-SVN-Rev: 16117
This commit is contained in:
Andy Heninger 2004-08-05 22:46:52 +00:00
parent 422c958275
commit afb730458f

View File

@ -885,6 +885,11 @@ int32_t RegexCImpl::appendTail(URegularExpression *regexp,
// The last call to find() on this matcher failed().
// Look back to the end of the last find() that succeeded for src index.
srcIdx = m->fLastMatchEnd;
if (srcIdx == -1) {
// There has been no successful match with this matcher.
// We want to copy the whole string.
srcIdx = 0;
}
}
int32_t destIdx = 0;