re_match_object = string;
val = re_search (bufp, (char *) XSTRING (string)->data,
- XSTRING (string)->size, 0, XSTRING (string)->size,
+ XSTRING (string)->size_byte, 0, XSTRING (string)->size_byte,
0);
immediate_quit = 0;
return val;
trivial_regexp_p (regexp)
Lisp_Object regexp;
{
- int len = XSTRING (regexp)->size;
+ int len = XSTRING (regexp)->size_byte;
unsigned char *s = XSTRING (regexp)->data;
unsigned char c;
while (--len >= 0)
if (RE && !trivial_regexp_p (string))
{
struct re_pattern_buffer *bufp;
+ int pos_byte = CHAR_TO_BYTE (pos);
+ int lim_byte = CHAR_TO_BYTE (lim);
bufp = compile_pattern (string, &search_regs, trt, posix,
!NILP (current_buffer->enable_multibyte_characters));
{
int val;
val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
- pos - BEGV, lim - pos, &search_regs,
+ pos_byte - BEGV_BYTE, lim_byte - pos_byte,
+ &search_regs,
/* Don't allow match past current point */
- pos - BEGV);
+ pos_byte - BEGV_BYTE);
if (val == -2)
{
matcher_overflow ();
{
int val;
val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
- pos - BEGV, lim - pos, &search_regs,
- lim - BEGV);
+ pos_byte - BEGV_BYTE, lim_byte - pos_byte,
+ &search_regs,
+ lim_byte - BEGV_BYTE);
if (val == -2)
{
matcher_overflow ();