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 --- include/monitor/readline.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/monitor') diff --git a/include/monitor/readline.h b/include/monitor/readline.h index fc9806ecf1..0faf6e1db7 100644 --- a/include/monitor/readline.h +++ b/include/monitor/readline.h @@ -8,7 +8,8 @@ #define READLINE_MAX_COMPLETIONS 256 typedef void ReadLineFunc(Monitor *mon, const char *str, void *opaque); -typedef void ReadLineCompletionFunc(const char *cmdline); +typedef void ReadLineCompletionFunc(Monitor *mon, + const char *cmdline); typedef struct ReadLineState { char cmd_buf[READLINE_CMD_BUF_SIZE + 1]; -- cgit v1.2.3