aboutsummaryrefslogtreecommitdiffstats
path: root/src/bidi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bidi.c')
-rw-r--r--src/bidi.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/bidi.c b/src/bidi.c
index 364d7e500ba..57d154bc544 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1353,15 +1353,19 @@ bidi_resolve_explicit_1 (struct bidi_it *bidi_it)
1353 : bidi_it->string.s); 1353 : bidi_it->string.s);
1354 1354
1355 if (bidi_it->charpos < 0) 1355 if (bidi_it->charpos < 0)
1356 bidi_it->charpos = 0; 1356 bidi_it->charpos = bidi_it->bytepos = 0;
1357 bidi_it->bytepos = bidi_count_bytes (p, 0, 0, bidi_it->charpos, 1357 eassert (bidi_it->bytepos == bidi_count_bytes (p, 0, 0,
1358 bidi_it->string.unibyte); 1358 bidi_it->charpos,
1359 bidi_it->string.unibyte));
1359 } 1360 }
1360 else 1361 else
1361 { 1362 {
1362 if (bidi_it->charpos < BEGV) 1363 if (bidi_it->charpos < BEGV)
1363 bidi_it->charpos = BEGV; 1364 {
1364 bidi_it->bytepos = CHAR_TO_BYTE (bidi_it->charpos); 1365 bidi_it->charpos = BEGV;
1366 bidi_it->bytepos = BEGV_BYTE;
1367 }
1368 eassert (bidi_it->bytepos == CHAR_TO_BYTE (bidi_it->charpos));
1365 } 1369 }
1366 } 1370 }
1367 /* Don't move at end of buffer/string. */ 1371 /* Don't move at end of buffer/string. */