1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00
putty-source/terminal
Simon Tatham 01d8561446 do_bidi: initialise paragraphOverride correctly.
I'd forgotten to initialise it at all, which meant it was set to zero
by the initial memset of the whole BidiContext on creation. But in our
enumeration of bidi character types, zero corresponds to L (the most
common left-to-right alphabetic character class), and as a value for
paragraphOverride, that is not neutral.

As a result, a command such as this (assuming UTF-8)

  echo -e '\xD7\x90\xD7\x91'

would produce Hebrew aleph and beth in the correct display order
(aleph on the right), but aligned to the left margin of the terminal
instead of the right margin, because the overall direction of the line
was taken to be forcibly overridden to "left-to-right" instead of
being inferred dynamically from the line contents.

do_bidi() is a tiny wrapper on the inner function that does all the
real work. And the inner function has been subjected to the whole
Unicode 14 bidi conformance test. So naturally, the "trivial" but
untested function just outside it is where the embarrassing bug was.
2022-05-24 17:43:48 +01:00
..
bidi_gettype.c Make bidi type enums into list macros. 2021-10-10 14:55:15 +01:00
bidi_test.c bidi_test: minor memory fixes. 2022-01-29 18:25:34 +00:00
bidi.c do_bidi: initialise paragraphOverride correctly. 2022-05-24 17:43:48 +01:00
bidi.h Test rig for the new bidi algorithm. 2021-10-10 15:00:30 +01:00
terminal.c Allow BEL to terminate OSC sequences during setup. 2022-05-12 18:01:42 +01:00
terminal.h Suspend terminal output while a window resize is pending. 2021-12-19 10:54:59 +00:00