aboutsummaryrefslogtreecommitdiff
path: root/readline.c
diff options
context:
space:
mode:
authorWenchao Xia <xiawenc@linux.vnet.ibm.com>2013-08-27 20:38:16 +0800
committerLuiz Capitulino <lcapitulino@redhat.com>2013-08-30 07:41:14 -0400
commitd2674b2cf7db7dce865f3c2b89f0e36d1657a3b5 (patch)
tree3b8fa75fe782da4527f4058f78236f8f47d2d982 /readline.c
parent599a926abcf581732d449163a96fd9a4cc80091a (diff)
downloadqemu-d2674b2cf7db7dce865f3c2b89f0e36d1657a3b5.zip
qemu-d2674b2cf7db7dce865f3c2b89f0e36d1657a3b5.tar.gz
qemu-d2674b2cf7db7dce865f3c2b89f0e36d1657a3b5.tar.bz2
monitor: avoid use of global *cur_mon in monitor_find_completion()
Parameter *mon is added, and local variable *mon added in previous patch is removed. The caller readline_completion(), pass rs->mon as value, which should be initialized in readline_init() called by monitor_init(). Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'readline.c')
-rw-r--r--readline.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/readline.c b/readline.c
index 1c0f7ee..c91b324 100644
--- a/readline.c
+++ b/readline.c
@@ -285,7 +285,7 @@ static void readline_completion(ReadLineState *rs)
cmdline = g_malloc(rs->cmd_buf_index + 1);
memcpy(cmdline, rs->cmd_buf, rs->cmd_buf_index);
cmdline[rs->cmd_buf_index] = '\0';
- rs->completion_finder(cmdline);
+ rs->completion_finder(rs->mon, cmdline);
g_free(cmdline);
/* no completion found */