From: Olivier Matz Date: Fri, 24 Dec 2010 12:55:19 +0000 (+0100) Subject: cmdline (merge-intel): don't display control character at the end of line X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9e20c1f99fb24b22eaed433a2227c3eeaa34b245;p=libcmdline.git cmdline (merge-intel): don't display control character at the end of line Signed-off-by: Olivier Matz --- 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