| 532 | /* Build the buffer PSTR->MBS, and apply the translation if we need. |
| 533 | This function is used in case of REG_ICASE. */ |
| 534 | |
| 535 | static void |
| 536 | internal_function |
| 537 | build_upper_buffer (re_string_t *pstr) |
| 538 | { |
| 539 | int char_idx, end_idx; |
| 540 | end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len; |
| 541 | |
| 542 | for (char_idx = pstr->valid_len; char_idx < end_idx; ++char_idx) |
| 543 | { |
| 544 | int ch = pstr->raw_mbs[pstr->raw_mbs_idx + char_idx]; |
| 545 | if (BE (pstr->trans != NULL, 0)) |
| 546 | ch = pstr->trans[ch]; |
| 547 | if (islower (ch)) |
| 548 | pstr->mbs[char_idx] = toupper (ch); |
| 549 | else |
| 550 | pstr->mbs[char_idx] = ch; |
| 551 | } |
| 552 | pstr->valid_len = char_idx; |
| 553 | pstr->valid_raw_len = char_idx; |
| 554 | } |
| 555 | |
| 556 | /* Apply TRANS to the buffer in PSTR. */ |
no outgoing calls
no test coverage detected