MCPcopy Create free account
hub / github.com/git/git / re_string_translate_buffer

Function re_string_translate_buffer

compat/regex/regex_internal.c:557–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

555
556/* Apply TRANS to the buffer in PSTR. */
557
558static void
559internal_function
560re_string_translate_buffer (re_string_t *pstr)
561{
562 int buf_idx, end_idx;
563 end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
564
565 for (buf_idx = pstr->valid_len; buf_idx < end_idx; ++buf_idx)
566 {
567 int ch = pstr->raw_mbs[pstr->raw_mbs_idx + buf_idx];
568 pstr->mbs[buf_idx] = pstr->trans[ch];
569 }
570
571 pstr->valid_len = buf_idx;
572 pstr->valid_raw_len = buf_idx;
573}
574
575/* This function re-construct the buffers.

Callers 3

re_string_constructFunction · 0.85
re_string_reconstructFunction · 0.85
internal_functionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected