From d2674b2cf7db7dce865f3c2b89f0e36d1657a3b5 Mon Sep 17 00:00:00 2001 From: Wenchao Xia Date: Tue, 27 Aug 2013 20:38:16 +0800 Subject: 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 Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- readline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'readline.c') diff --git a/readline.c b/readline.c index 1c0f7ee26b..c91b324cb1 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 */ -- cgit v1.2.3