From 4eb60cd3a157ff99d380028687e07f01354c65fc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 11 Oct 2014 15:21:26 +0300 Subject: [PATCH] Reset the bracket_resolved flag before advancing to next character. --- src/bidi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bidi.c b/src/bidi.c index a1fe68faab4..37d7a6f4974 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -2382,7 +2382,7 @@ bidi_resolve_bracket_pairs (struct bidi_it *bidi_it) & (FLAG_OPPOSITE_INSIDE | FLAG_OPPOSITE_OUTSIDE)) == (FLAG_OPPOSITE_INSIDE | FLAG_OPPOSITE_OUTSIDE)) type = ((embedding_level & 1) ? STRONG_L : STRONG_R); - else if (bpa_stack[sp].flags & FLAG_OPPOSITE_INSIDE) /* N0c2 */ + else if (bpa_stack[sp].flags & FLAG_OPPOSITE_INSIDE) /*N0c2*/ type = ((embedding_level & 1) ? STRONG_R : STRONG_L); /* Update and cache the closing bracket. */ @@ -2777,6 +2777,9 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) && bidi_it->charpos >= bidi_it->next_for_ws.charpos) bidi_it->next_for_ws.type = UNKNOWN_BT; + /* Resete the bracket_resolved flag. */ + bidi_it->bracket_resolved = 0; + /* This must be taken before we fill the iterator with the info about the next char. If we scan backwards, the iterator state must be already cached, so there's no need to know the -- 2.39.5