From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ux7Ma-0002lz-Ty for qemu-devel@nongnu.org; Wed, 10 Jul 2013 23:16:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ux7MZ-0000wz-SB for qemu-devel@nongnu.org; Wed, 10 Jul 2013 23:16:12 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:50782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ux7MZ-0000wJ-7g for qemu-devel@nongnu.org; Wed, 10 Jul 2013 23:16:11 -0400 Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Jul 2013 13:13:15 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 44B062BB0053 for ; Thu, 11 Jul 2013 13:16:07 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6B30nhx50987222 for ; Thu, 11 Jul 2013 13:00:50 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6B3G69Y016126 for ; Thu, 11 Jul 2013 13:16:06 +1000 From: Wenchao Xia Date: Thu, 11 Jul 2013 11:13:38 +0800 Message-Id: <1373512429-17865-3-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1373512429-17865-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1373512429-17865-1-git-send-email-xiawenc@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH V6 02/13] monitor: avoid use of global *cur_mon in file_completion() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, Wenchao Xia , armbru@redhat.com, lcapitulino@redhat.com Signed-off-by: Wenchao Xia --- monitor.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index 7398d00..181d5b0 100644 --- a/monitor.c +++ b/monitor.c @@ -4022,7 +4022,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; @@ -4045,7 +4045,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); @@ -4072,7 +4072,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); @@ -4183,7 +4183,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