enable-multibyte-characters.
(Fchars_in_region): Likewise. Avoid error when the region ends in
the middle of a multibyte character.
CHECK_STRING (str, 0);
+ if (NILP (current_buffer->enable_multibyte_characters))
+ return make_number (XSTRING (str)->size);
+
p = XSTRING (str)->data; endp = p + XSTRING (str)->size;
chars = 0;
while (p < endp)
to = max (XFASTINT (beg), XFASTINT (end));
p = POS_ADDR (from);
+ if (NILP (current_buffer->enable_multibyte_characters))
+ return make_number (to - from);
+
if (from < GPT && GPT <= to)
{
stop = GPT;
while (1)
{
- if (p == endp)
+ if (p >= endp)
{
- if (stop == to)
+ if (stop >= to)
break;
p = POS_ADDR (stop);