Selaa lähdekoodia

[console] Fix display of characters with top bit set

Inhibit implicit sign-padding of characters with the top bit set
(e.g. accented characters), which confuses the mucurses library by
colliding with the bits used to store character attributes and
colours.

Reported-by: Marc Delisle <Marc.Delisle@cegepsherbrooke.qc.ca>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 vuotta sitten
vanhempi
commit
a17ee3610d
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1
    1
      src/core/vsprintf.c
  2. 1
    1
      src/hci/mucurses/mucurses.c

+ 1
- 1
src/core/vsprintf.c Näytä tiedosto

@@ -167,7 +167,7 @@ static char * format_decimal ( char *end, signed long num, int width,
167 167
  * Call's the printf_context::handler() method and increments
168 168
  * printf_context::len.
169 169
  */
170
-static inline void cputchar ( struct printf_context *ctx, unsigned int c ) {
170
+static inline void cputchar ( struct printf_context *ctx, unsigned char c ) {
171 171
 	ctx->handler ( ctx, c );
172 172
 	++ctx->len;
173 173
 }

+ 1
- 1
src/hci/mucurses/mucurses.c Näytä tiedosto

@@ -75,7 +75,7 @@ void _wputch ( WINDOW *win, chtype ch, int wrap ) {
75 75
  * @v wrap	wrap "switch"
76 76
  */
77 77
 void _wputc ( WINDOW *win, char c, int wrap ) {
78
-	_wputch ( win, ( c | win->attrs ), wrap );
78
+	_wputch ( win, ( ( ( unsigned char ) c ) | win->attrs ), wrap );
79 79
 }
80 80
 
81 81
 /**

Loading…
Peruuta
Tallenna