From 9e20c1f99fb24b22eaed433a2227c3eeaa34b245 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Fri, 24 Dec 2010 13:55:19 +0100 Subject: [PATCH] cmdline (merge-intel): don't display control character at the end of line Signed-off-by: Olivier Matz --- src/lib/cmdline_rdline.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib/cmdline_rdline.c b/src/lib/cmdline_rdline.c index d5eac3b..48cf03e 100644 --- a/src/lib/cmdline_rdline.c +++ b/src/lib/cmdline_rdline.c @@ -169,14 +169,15 @@ display_right_buffer(struct rdline *rdl) unsigned int i; char tmp; + if (CIRBUF_IS_EMPTY(&rdl->right)) + return; + rdline_puts(rdl, vt100_clear_right); - if (!CIRBUF_IS_EMPTY(&rdl->right)) { - CIRBUF_FOREACH(&rdl->right, i, tmp) { - rdl->write_char(rdl, tmp); - } - rdline_miniprintf(rdl, vt100_multi_left, - CIRBUF_GET_LEN(&rdl->right)); + CIRBUF_FOREACH(&rdl->right, i, tmp) { + rdl->write_char(rdl, tmp); } + rdline_miniprintf(rdl, vt100_multi_left, + CIRBUF_GET_LEN(&rdl->right)); } void -- 2.20.1