Commit 05e193f1 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Don't sync charpos and bytepos in bidi_resolve_explicit_1.

 src/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>.
parent d37e4893
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.
......
......@@ -1353,15 +1353,19 @@ bidi_resolve_explicit_1 (struct bidi_it *bidi_it)
: 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. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment