If readline_handle_byte() is sent both a CR and LF, and
readline_start() is not called after the first CR, then the LF will
cause the same command to be executed a second time.  Fix this by
explicitly resetting the buffer pointer when it is processed.

Signed-off-by: Jim Paris <[EMAIL PROTECTED]>
---

This should probably get pushed upstream too.

 qemu/readline.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu/readline.c b/qemu/readline.c
index cbe33db..bde3342 100644
--- a/qemu/readline.c
+++ b/qemu/readline.c
@@ -335,6 +335,8 @@ void readline_handle_byte(int ch)
             if (!term_is_password)
                 term_hist_add(term_cmd_buf);
             term_printf("\n");
+            term_cmd_buf_index = 0;
+            term_cmd_buf_size = 0;
             /* NOTE: readline_start can be called here */
             term_readline_func(term_readline_opaque, term_cmd_buf);
             break;
-- 
1.5.3.GIT


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to