From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2Ycf-0001j7-DE for qemu-devel@nongnu.org; Thu, 25 Jul 2013 23:23:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2Ycd-0005rB-4y for qemu-devel@nongnu.org; Thu, 25 Jul 2013 23:23:16 -0400 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:41065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2Ycb-0005pq-Lz for qemu-devel@nongnu.org; Thu, 25 Jul 2013 23:23:15 -0400 Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 26 Jul 2013 08:47:45 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 1E8271258051 for ; Fri, 26 Jul 2013 08:52:26 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6Q3Ns0B27525340 for ; Fri, 26 Jul 2013 08:53:54 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6Q3MxX5020793 for ; Fri, 26 Jul 2013 13:22:59 +1000 From: Wenchao Xia Date: Fri, 26 Jul 2013 11:20:31 +0800 Message-Id: <1374808842-11051-3-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1374808842-11051-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1374808842-11051-1-git-send-email-xiawenc@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH V8 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 Reviewed-by: Eric Blake --- monitor.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index c2babba..dc66dca 100644 --- a/monitor.c +++ b/monitor.c @@ -4030,7 +4030,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; @@ -4053,7 +4053,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); @@ -4080,7 +4080,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); @@ -4191,7 +4191,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