Fixed display bug with some special chars in messages (some words were truncated on screen) (bug #20944)

This commit is contained in:
Sebastien Helleu 2007-09-02 15:34:29 +00:00
parent dd0b1701e3
commit 68fd773730
2 changed files with 8 additions and 2 deletions

View File

@ -1,10 +1,12 @@
WeeChat - Wee Enhanced Environment for Chat WeeChat - Wee Enhanced Environment for Chat
=========================================== ===========================================
ChangeLog - 2007-08-31 ChangeLog - 2007-09-02
Version 0.2.6 (under dev!): Version 0.2.6 (under dev!):
* fixed display bug with some special chars in messages (some words were
truncated on screen) (bug #20944)
* fixed UTF-8 bug with color encoding/decoding * fixed UTF-8 bug with color encoding/decoding
* fixed crash when searching text in buffer with ctrl-R (bug #20938) * fixed crash when searching text in buffer with ctrl-R (bug #20938)
* added string length limit for setup file options * added string length limit for setup file options

View File

@ -457,6 +457,8 @@ gui_chat_word_get_next_char (t_gui_window *window, unsigned char *string,
memcpy (utf_char, string, char_size); memcpy (utf_char, string, char_size);
utf_char[char_size] = '\0'; utf_char[char_size] = '\0';
*width_screen = utf8_width_screen (utf_char); *width_screen = utf8_width_screen (utf_char);
if (*width_screen < 0)
*width_screen = char_size;
} }
return (char *)string + char_size; return (char *)string + char_size;
} }
@ -494,7 +496,9 @@ gui_chat_display_word_raw (t_gui_window *window, char *string, int display)
{ {
saved_char = next_char[0]; saved_char = next_char[0];
next_char[0] = '\0'; next_char[0] = '\0';
if (((unsigned char)(prev_char[0]) == 146) && (!prev_char[1])) if ((((unsigned char)(prev_char[0]) == 146)
|| ((unsigned char)(prev_char[0]) == 0x7F))
&& (!prev_char[1]))
wprintw (GUI_CURSES(window)->win_chat, "."); wprintw (GUI_CURSES(window)->win_chat, ".");
else else
{ {