cmdline (merge-intel): don't display control character at the end of line
authorOlivier Matz <zer0@droids-corp.org>
Fri, 24 Dec 2010 12:55:19 +0000 (13:55 +0100)
committerOlivier Matz <zer0@droids-corp.org>
Sun, 2 Jan 2011 20:53:15 +0000 (21:53 +0100)
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
src/lib/cmdline_rdline.c

index d5eac3b..48cf03e 100644 (file)
@@ -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