From: Eli Zaretskii Date: Thu, 3 Mar 2022 12:46:20 +0000 (+0200) Subject: Fix handling of brackets in BPA X-Git-Tag: emacs-28.0.92~15 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cd51d9c7ab5914fb58cbba6ae7bf5d53f7fef03f;p=emacs.git Fix handling of brackets in BPA * src/bidi.c (bidi_resolve_brackets): Fix implementation of UBA's N0 rule when there are no strong directional characters inside the bracketed pair. (Bug#54219) --- diff --git a/src/bidi.c b/src/bidi.c index 30a3be6c94e..5f47d9e9a7c 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -2924,7 +2924,8 @@ bidi_resolve_brackets (struct bidi_it *bidi_it) eassert (bidi_it->bracket_pairing_pos > bidi_it->charpos); if (bidi_it->bracket_enclosed_type == embedding_type) /* N0b */ type = embedding_type; - else + else if (bidi_it->bracket_enclosed_type == STRONG_L /* N0c, N0d */ + || bidi_it->bracket_enclosed_type == STRONG_R) { switch (bidi_it->prev_for_neutral.type) { @@ -2944,6 +2945,7 @@ bidi_resolve_brackets (struct bidi_it *bidi_it) break; default: /* N0d: Do not set the type for that bracket pair. */ + /* (Actuallly, this shouldn't happen.) */ break; } }