diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-05 23:01:10 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-05 23:01:10 +0000 |
commit | 9dd442b1234a27375c956e650e49a32c61ff6167 (patch) | |
tree | 8f5f65e47e3919dae5daa93f3741516e5c084482 /readline.c | |
parent | monitor: Simplify password input mode (Jan Kiszka) (diff) | |
download | qemu-kvm-9dd442b1234a27375c956e650e49a32c61ff6167.tar.gz qemu-kvm-9dd442b1234a27375c956e650e49a32c61ff6167.tar.bz2 qemu-kvm-9dd442b1234a27375c956e650e49a32c61ff6167.zip |
monitor: Break out readline_show_prompt (Jan Kiszka)
Break readline_show_prompt out of readline_start so that (re-)printing
the prompt can be controlled in a more fine-grained way.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6709 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'readline.c')
-rw-r--r-- | readline.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/readline.c b/readline.c index 85728412e..5a089be89 100644 --- a/readline.c +++ b/readline.c @@ -57,7 +57,7 @@ static int term_is_password; static char term_prompt[256]; static void *term_readline_opaque; -static void term_show_prompt2(void) +void readline_show_prompt(void) { term_printf("%s", term_prompt); term_flush(); @@ -66,13 +66,6 @@ static void term_show_prompt2(void) term_esc_state = IS_NORM; } -static void term_show_prompt(void) -{ - term_show_prompt2(); - term_cmd_buf_index = 0; - term_cmd_buf_size = 0; -} - /* update the displayed command line */ static void term_update(void) { @@ -360,7 +353,7 @@ static void term_completion(void) j = 0; } } - term_show_prompt2(); + readline_show_prompt(); } } @@ -473,7 +466,8 @@ void readline_start(const char *prompt, int is_password, term_readline_func = readline_func; term_readline_opaque = opaque; term_is_password = is_password; - term_show_prompt(); + term_cmd_buf_index = 0; + term_cmd_buf_size = 0; } const char *readline_get_history(unsigned int index) |