Patch for get_word - please look

Bohdan R. Rau ethanak at polip.com
Sun Jul 8 02:32:46 EDT 2012


 Hello

 Originally function get_word operates with signed char and compares it 
 numerically with SPACE to check, if this character may be part of word. 
 It is true only for 7-bit characters, accented letters (with most 
 significant bit set) will be treated as negative and condition "greater 
 than SPACE" will be always false. In effect, get_word can't recognize 
 word starting with accented letter.

 You can simply reproduce this bug.
 If you are non-english speaker and you have console properly working in 
 ISO-1 or ISO-2, simply echo some sentence in your native language with 
 some word inside sentence starting with accented letter. For Polish 
 language in ISO-2 please enter:

 echo stary pies łapie lisa

 If you have keyboard not configured for non-ascii letters, you must 
 have console working in ISO-1 or ISO-2, and then enter something like:

 echo -e "Linux \xfcber alles"

 For Cyrillic scripts simply echo some sentence.

 Then press 'previous line' and try to navigate with previous/next word. 
 You will never hear word starting with accented letter, but previous 
 word instead (for example 'linux' instead of 'über'). For cyrillic you 
 will always hear first word

 My patch simply changes signed char to unsigned char. It's not the best 
 solution, as get_word should be simplified (in fact, we do not need to 
 check 'can the character be part of word' for character inside word), 
 but seems to be working perfectly with ISO-2. I also make very short 
 test with ISO-5 (using builtin Milena cyrillic translator instead of 
 russian synthesizer) and also I had no problem with navigation by word.

 Would you take a look on attached patch?

 ethanak
-- 
 http://milena.polip.com/ - Pa pa, Ivonko!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getword.patch
Type: text/x-patch
Size: 1553 bytes
Desc: not available
URL: <http://linux-speakup.org/pipermail/speakup/attachments/20120708/d258aefb/attachment.bin>


More information about the Speakup mailing list