From 652a97cc7af805e5cbbd2671d5a98998188ab041 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Thu, 11 Jun 2009 15:31:53 +0200 Subject: Fix display bug with color/attribute chars (< 32) in command line (bug #26749) --- src/gui/gui-chat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index 80f11e611..ff45be3fa 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -129,7 +129,7 @@ gui_chat_strlen_screen (const char *string) string = gui_chat_string_next_char (NULL, (unsigned char *)string, 0); if (string) { - size_on_screen = utf8_char_size_screen (string); + size_on_screen = (string[0] < 32) ? 1 : utf8_char_size_screen (string); if (size_on_screen > 0) length += size_on_screen; string = utf8_next_char (string); @@ -183,7 +183,7 @@ gui_chat_string_real_pos (const char *string, int pos) 0); if (ptr_string) { - size_on_screen = utf8_char_size_screen (ptr_string); + size_on_screen = (ptr_string[0] < 32) ? 1 : utf8_char_size_screen (ptr_string); if (size_on_screen > 0) pos -= size_on_screen; ptr_string = utf8_next_char (ptr_string); -- cgit v1.2.3