[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V9 02/15] monitor: avoid use of global *cur_mon in f
From: |
Wenchao Xia |
Subject: |
[Qemu-devel] [PATCH V9 02/15] monitor: avoid use of global *cur_mon in file_completion() |
Date: |
Fri, 23 Aug 2013 16:17:54 +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 e0154a8..30819fa 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 V9 00/15] monitor: support sub command group in auto completion and help, Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 01/15] monitor: avoid use of global *cur_mon in cmd_completion(), Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 03/15] monitor: avoid use of global *cur_mon in block_completion_it(), Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 04/15] monitor: avoid use of global *cur_mon in monitor_find_completion(), Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 05/15] monitor: avoid use of global *cur_mon in readline_completion(), Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 06/15] monitor: call sortcmdlist() only one time, Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 02/15] monitor: avoid use of global *cur_mon in file_completion(),
Wenchao Xia <=
- [Qemu-devel] [PATCH V9 07/15] monitor: split off monitor_data_init(), Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 08/15] monitor: avoid direct use of global variable *mon_cmds, Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 09/15] monitor: code move for parse_cmdline(), Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 10/15] monitor: refine parse_cmdline(), Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 11/15] monitor: support sub command in help, Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 12/15] monitor: refine monitor_find_completion(), Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 13/15] monitor: support sub command in auto completion, Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 14/15] monitor: allow "help" show message for single command in sub group, Wenchao Xia, 2013/08/23
- [Qemu-devel] [PATCH V9 15/15] monitor: improve auto complete of "help" for single command in sub group, Wenchao Xia, 2013/08/23
- Re: [Qemu-devel] [PATCH V9 00/15] monitor: support sub command group in auto completion and help, Luiz Capitulino, 2013/08/26