[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V10 02/15] monitor: avoid use of global *cur_mon in
From: |
Wenchao Xia |
Subject: |
[Qemu-devel] [PATCH V10 02/15] monitor: avoid use of global *cur_mon in file_completion() |
Date: |
Tue, 27 Aug 2013 20:38:14 +0800 |
Signed-off-by: Wenchao Xia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
monitor.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/monitor.c b/monitor.c
index 31b527d..a59a402 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4034,7 +4034,7 @@ static void cmd_completion(Monitor *mon, const char
*name, const char *list)
}
}
-static void file_completion(const char *input)
+static void file_completion(Monitor *mon, const char *input)
{
DIR *ffs;
struct dirent *d;
@@ -4057,7 +4057,7 @@ static void file_completion(const char *input)
pstrcpy(file_prefix, sizeof(file_prefix), p + 1);
}
#ifdef DEBUG_COMPLETION
- monitor_printf(cur_mon, "input='%s' path='%s' prefix='%s'\n",
+ monitor_printf(mon, "input='%s' path='%s' prefix='%s'\n",
input, path, file_prefix);
#endif
ffs = opendir(path);
@@ -4084,7 +4084,7 @@ static void file_completion(const char *input)
if (stat(file, &sb) == 0 && S_ISDIR(sb.st_mode)) {
pstrcat(file, sizeof(file), "/");
}
- readline_add_completion(cur_mon->rs, file);
+ readline_add_completion(mon->rs, file);
}
}
closedir(ffs);
@@ -4195,7 +4195,7 @@ static void monitor_find_completion(const char *cmdline)
case 'F':
/* file completion */
readline_set_completion_index(cur_mon->rs, strlen(str));
- file_completion(str);
+ file_completion(mon, str);
break;
case 'B':
/* block device name completion */
--
1.7.1
- [Qemu-devel] [PATCH V10 00/15] monitor: support sub command group in auto completion and help, Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 01/15] monitor: avoid use of global *cur_mon in cmd_completion(), Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 02/15] monitor: avoid use of global *cur_mon in file_completion(),
Wenchao Xia <=
- [Qemu-devel] [PATCH V10 03/15] monitor: avoid use of global *cur_mon in block_completion_it(), Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 05/15] monitor: avoid use of global *cur_mon in readline_completion(), Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 06/15] monitor: call sortcmdlist() only one time, Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 07/15] monitor: split off monitor_data_init(), Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 08/15] monitor: avoid direct use of global variable *mon_cmds, Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 09/15] monitor: code move for parse_cmdline(), Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 10/15] monitor: refine parse_cmdline(), Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 04/15] monitor: avoid use of global *cur_mon in monitor_find_completion(), Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 11/15] monitor: support sub command in help, Wenchao Xia, 2013/08/27
- [Qemu-devel] [PATCH V10 12/15] monitor: refine monitor_find_completion(), Wenchao Xia, 2013/08/27