pstr->mbs_case = (char *) pstr->raw_mbs;
pstr->mbs_case = (unsigned char *) pstr->raw_mbs;
re_string_reconstruct (pstr, idx, eflags, newline)     re_string_t *pstr;     int idx, eflags, newline;{  int offset = idx - pstr->raw_mbs_idx;  if (offset < 0)    {      /* Reset buffer.  */#ifdef RE_ENABLE_I18N      if (MB_CUR_MAX > 1)        memset (&pstr->cur_state, '\0', sizeof (mbstate_t));#endif /* RE_ENABLE_I18N */      pstr->valid_len = pstr->raw_mbs_idx = 0;      pstr->tip_context = ((eflags & REG_NOTBOL) ? CONTEXT_BEGBUF                           : CONTEXT_NEWLINE | CONTEXT_BEGBUF);      if (!MBS_CASE_ALLOCATED (pstr))        pstr->mbs_case = (char *) pstr->raw_mbs;      if (!MBS_ALLOCATED (pstr) && !MBS_CASE_ALLOCATED (pstr))        pstr->mbs = (char *) pstr->raw_mbs;      offset = idx;    }  if (offset != 0)    {      pstr->tip_context = re_string_context_at (pstr, offset - 1, eflags,                                                newline);      /* Are the characters which are already checked remain?  */      if (offset < pstr->valid_len)        {          /* Yes, move them to the front of the buffer.  */#ifdef RE_ENABLE_I18N          if (MB_CUR_MAX > 1)            memmove (pstr->wcs, pstr->wcs + offset,                     (pstr->valid_len - offset) * sizeof (wint_t));#endif /* RE_ENABLE_I18N */          if (MBS_ALLOCATED (pstr))            memmove (pstr->mbs, pstr->mbs + offset,                     pstr->valid_len - offset);          if (MBS_CASE_ALLOCATED (pstr))            memmove (pstr->mbs_case, pstr->mbs_case + offset,                     pstr->valid_len - offset);          pstr->valid_len -= offset;#if DEBUG          assert (pstr->valid_len > 0);#endif        }      else        {          /* No, skip all characters until IDX.  */          pstr->valid_len = 0;#ifdef RE_ENABLE_I18N          if (MB_CUR_MAX > 1)            {              int wcs_idx;              pstr->valid_len = re_string_skip_chars (pstr, idx) - idx;              for (wcs_idx = 0; wcs_idx < pstr->valid_len; ++wcs_idx)                pstr->wcs[wcs_idx] = WEOF;            }#endif /* RE_ENABLE_I18N */        }      if (!MBS_CASE_ALLOCATED (pstr))        {          pstr->mbs_case += offset;           /* In case of !MBS_ALLOCATED && !MBS_CASE_ALLOCATED.  */          if (!MBS_ALLOCATED (pstr))            pstr->mbs += offset;         }    }  pstr->raw_mbs_idx = idx;  pstr->len -= offset;  pstr->stop -= offset;  /* Then build the buffers.  */#ifdef RE_ENABLE_I18N  if (MB_CUR_MAX > 1)    {      if (pstr->icase)        build_wcs_upper_buffer (pstr);      else        build_wcs_buffer (pstr);    }  else#endif /* RE_ENABLE_I18N */    {      if (pstr->icase)        build_upper_buffer (pstr);      else if (pstr->trans != NULL)        re_string_translate_buffer (pstr);    }  pstr->cur_idx = 0;  return REG_NOERROR;}