commit 40a74e46e61747ad905bf2bbcb538b62526f0a37
parent c3cd0f3411004a7d08978df0074c953456927c78
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Mon, 4 Mar 2019 15:33:49 -0600
display: correct the logic for making room for the ">" character
The change in commit edc0d628 was flawed. The old logic covered
every case but one: having reached the end of 'buf' but 'column'
still having overshot the screen width. Now cover this latter
case too.
This fixes https://savannah.gnu.org/bugs/?55638 properly,
allowing the next commit to fix another buglet.
Condensed-by: Benno Schulenberg <bensberg@telfort.nl>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -1991,8 +1991,8 @@ char *display_string(const char *buf, size_t column, size_t span,
}
/* If there is more text than can be shown, make room for the ">". */
- if ((*buf != '\0' || column > beyond) &&
- (isprompt || (isdata && !ISSET(SOFTWRAP)))) {
+ if (column > beyond || (*buf != '\0' && (isprompt ||
+ (isdata && !ISSET(SOFTWRAP))))) {
do {
index = move_mbleft(converted, index);
} while (mbwidth(converted + index) == 0);