From cd51d9c7ab5914fb58cbba6ae7bf5d53f7fef03f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 3 Mar 2022 14:46:20 +0200 Subject: [PATCH] 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) --- src/bidi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } } -- 2.39.2