aboutsummaryrefslogtreecommitdiffstats
path: root/src/bidi.c
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2010-04-03 16:43:23 +0300
committerEli Zaretskii <[email protected]>2010-04-03 16:43:23 +0300
commit1502b819370b4194a3050702229ca3d239700e02 (patch)
tree1a8890d155b3e5d8d80da0e8ec55e3ba6e5c491a /src/bidi.c
parent83d02defcee08fdd17b15d69766a4dbe40112da8 (diff)
Fix infloop in bidi buffers with vertical cursor motion at ZV.
bidi.c (bidi_resolve_explicit, bidi_level_of_next_char): Check bidi_it->bytepos against ZV_BYTE instead of bidi_it->ch against BIDI_EOB.
Diffstat (limited to 'src/bidi.c')
-rw-r--r--src/bidi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bidi.c b/src/bidi.c
index ea47cd33fe..7da8cd4a88 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1242,7 +1242,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
if (prev_level < new_level
&& bidi_it->type == WEAK_BN
&& bidi_it->ignore_bn_limit == 0 /* only if not already known */
- && bidi_it->ch != BIDI_EOB /* not already at EOB */
+ && bidi_it->bytepos < ZV_BYTE /* not already at EOB */
&& bidi_explicit_dir_char (FETCH_CHAR (bidi_it->bytepos
+ bidi_it->ch_len)))
{
@@ -1648,7 +1648,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
if (bidi_it->scan_dir == 1)
{
/* There's no sense in trying to advance if we hit end of text. */
- if (bidi_it->ch == BIDI_EOB)
+ if (bidi_it->bytepos >= ZV_BYTE)
return bidi_it->resolved_level;
/* Record the info about the previous character. */