Discussion:
[patch 1/2] speakup: Fix hang on spelling words with non-latin1 characters
Samuel Thibault
2017-03-12 01:56:07 UTC
Permalink
9831013cbdbd3d06430a1db01d8c32d50c7d1c04 ('speakup: convert screen reading to
16bit characters') made spell_word() ignore non-latin1 characters now read from
the VC, but it missed actually skipping them, leading to an infinite loop. This fixes it by just advancing the unicode character pointer.

Reported-by: Zahari Yurukov <***@gmail.com>
Signed-off-by: Samuel Thibault <***@ens-lyon.org>
Tested-by: Zahari Yurukov <***@gmail.com>

Index: linux-2.6/drivers/staging/speakup/main.c
===================================================================
--- linux-2.6.orig/drivers/staging/speakup/main.c
+++ linux-2.6/drivers/staging/speakup/main.c
@@ -718,8 +718,11 @@ static void spell_word(struct vc_data *v
return;
while ((ch = *cp)) {
if (ch >= 0x100)
+ {
/* FIXME */
+ cp++;
continue;
+ }
if (cp != buf)
synth_printf(" %s ", delay_str[spk_spell_delay]);
if (IS_CHAR(ch, B_CAP)) {
Samuel Thibault
2017-03-12 01:56:08 UTC
Permalink
9831013cbdbd3d06430a1db01d8c32d50c7d1c04 ('speakup: convert screen reading to
16bit characters') paved the way for handling unicode characters in speakup, but
for the review mode, it missed actually getting unicode characters from the VC. This fixes by just turning the use_unicode parameter to 1.

Reported-by: Zahari Yurukov <***@gmail.com>
Signed-off-by: Samuel Thibault <***@ens-lyon.org>
Tested-by: Zahari Yurukov <***@gmail.com>

Index: linux-2.6/drivers/staging/speakup/main.c
===================================================================
--- linux-2.6.orig/drivers/staging/speakup/main.c
+++ linux-2.6/drivers/staging/speakup/main.c
@@ -483,7 +483,7 @@ static u16 get_char(struct vc_data *vc,
c |= 0x100;
}

- ch = inverse_translate(vc, c, 0);
+ ch = inverse_translate(vc, c, 1);
*attribs = (w & 0xff00) >> 8;
}
return ch;
Samuel Thibault
2017-03-13 14:26:23 UTC
Permalink
Run your patches through scripts/checkpatch.pl
D'oh. For such a small patch, I didn't bother doing it indeed. Anyway,
that's superseded by version 2 I have submitted (speakup: Support
spelling unicode characters)

Samuel

Loading...