ICU-966 fix calculation of error context length

X-SVN-Rev: 4946
This commit is contained in:
Alan Liu 2001-06-11 22:55:31 +00:00
parent 8aa6ff0e26
commit d43d381a4d

View File

@ -770,7 +770,7 @@ int32_t TransliterationRuleParser::syntaxError(int32_t parseErrorCode,
if (end < 0) {
end = rule.length();
}
int32_t len = uprv_max(end - start, U_PARSE_CONTEXT_LEN-1);
int32_t len = uprv_min(end - start, U_PARSE_CONTEXT_LEN-1);
// Extract everything into the preContext and leave the postContext
// blank, since we don't have precise error position.
// TODO: Fix this.