From 98a18f45c4a7939de9f4d6fde05f4ba105a11f8d Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 5 Jun 2014 12:13:05 -0700 Subject: [PATCH] GUAC-726: Fix width calculation math. Do not search for start past column 0. --- src/terminal/terminal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/terminal/terminal.c b/src/terminal/terminal.c index 2879c806..6b3448b8 100644 --- a/src/terminal/terminal.c +++ b/src/terminal/terminal.c @@ -83,13 +83,13 @@ static void __guac_terminal_force_break(guac_terminal* terminal, int row, int ed guac_terminal_char* start_char = &(buffer_row->characters[start_column]); /* Determine start column */ - while (start_column >= 0 && start_char->value == GUAC_CHAR_CONTINUATION) { + while (start_column > 0 && start_char->value == GUAC_CHAR_CONTINUATION) { start_char--; start_column--; } /* Clear character if broken */ - if (start_char->value == GUAC_CHAR_CONTINUATION || start_char->width != start_column - end_column + 1) { + if (start_char->value == GUAC_CHAR_CONTINUATION || start_char->width != end_column - start_column + 1) { guac_terminal_char cleared_char; cleared_char.value = ' '; @@ -118,7 +118,7 @@ static void __guac_terminal_force_break(guac_terminal* terminal, int row, int ed } /* Clear character if broken */ - if (start_char->value == GUAC_CHAR_CONTINUATION || start_char->width != start_column - end_column + 1) { + if (start_char->value == GUAC_CHAR_CONTINUATION || start_char->width != end_column - start_column + 1) { guac_terminal_char cleared_char; cleared_char.value = ' ';