rdline: don't include '\n' in rdline buffer when user validates
authorOlivier Matz <zer0@droids-corp.org>
Sun, 31 Jul 2011 19:51:59 +0000 (21:51 +0200)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 27 Oct 2011 20:46:48 +0000 (22:46 +0200)
Signed-off-by: Olivier Matz <zer0@droids-corp.org>
src/lib/cmdline_rdline.c

index 4c746fa..5632a87 100644 (file)
@@ -474,8 +474,7 @@ rdline_parse_char(struct rdline *rdl, char c)
                                cirbuf_add_tail(&rdl->left, tmp);
                        }
                        cirbuf_align_left(&rdl->left);
-                       rdl->left_buf[CIRBUF_GET_LEN(&rdl->left)] = '\n';
-                       rdl->left_buf[CIRBUF_GET_LEN(&rdl->left) + 1] = '\0';
+                       rdl->left_buf[CIRBUF_GET_LEN(&rdl->left)] = '\0';
                        rdline_printf(rdl, "\r\n");
 #ifndef NO_RDLINE_HISTORY
                        if (rdl->history_cur_line != -1)