+2013-03-05 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
+ bidi_count_bytes, as the callers now arrange for bidi_it->charpos
+ to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
+ <dmantipov@yandex.ru>.
+
2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
Fix a build failure on OpenBSD 4.x and MirBSD.
: bidi_it->string.s);
if (bidi_it->charpos < 0)
- bidi_it->charpos = 0;
- bidi_it->bytepos = bidi_count_bytes (p, 0, 0, bidi_it->charpos,
- bidi_it->string.unibyte);
+ bidi_it->charpos = bidi_it->bytepos = 0;
+ eassert (bidi_it->bytepos == bidi_count_bytes (p, 0, 0,
+ bidi_it->charpos,
+ bidi_it->string.unibyte));
}
else
{
if (bidi_it->charpos < BEGV)
- bidi_it->charpos = BEGV;
- bidi_it->bytepos = CHAR_TO_BYTE (bidi_it->charpos);
+ {
+ bidi_it->charpos = BEGV;
+ bidi_it->bytepos = BEGV_BYTE;
+ }
+ eassert (bidi_it->bytepos == CHAR_TO_BYTE (bidi_it->charpos));
}
}
/* Don't move at end of buffer/string. */