[orca: 1/2] braille: make sure the attribute mask is as long as the text string



commit 032a7617e2f99450f6c7d72d3b9c2696df835413
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Mon Dec 3 12:30:24 2018 +0100

    braille: make sure the attribute mask is as long as the text string
    
    otherwise brlapi would get uninitialized bytes and thus output garbage
    at the end of the output.

 src/orca/braille.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/braille.py b/src/orca/braille.py
index 3534c44a8..e536f31cc 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -1216,8 +1216,10 @@ def refresh(panToCursor=True,
     substring = string[startPos:endPos]
     if attributeMask:
         submask = attributeMask[startPos:endPos]
-    else:
-        submask = '\x00' * (endPos - startPos)
+    else
+        submask = ""
+
+    submask += '\x00' * (len(substring) - len(submask))
     if not _brlAPIRunning:
         init(_callback, settings.tty)
     if _brlAPIRunning:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]