From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtkxX-0001fL-Gl for qemu-devel@nongnu.org; Fri, 11 Jan 2013 15:12:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtkxV-00026K-SM for qemu-devel@nongnu.org; Fri, 11 Jan 2013 15:12:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtkxV-00026C-KU for qemu-devel@nongnu.org; Fri, 11 Jan 2013 15:12:09 -0500 Date: Fri, 11 Jan 2013 18:12:09 -0200 From: Luiz Capitulino Message-ID: <20130111181209.5f045b19@doriath.home> In-Reply-To: <1357895645-30359-5-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1357895645-30359-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1357895645-30359-5-git-send-email-xiawenc@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V5 4/6] HMP: filter out space before check of sub-command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, chenwj@iis.sinica.edu.tw, armbru@redhat.com On Fri, 11 Jan 2013 17:14:03 +0800 Wenchao Xia wrote: > This fix the case when user input "@command ". Original > it will return NULL for monitor_parse_command(), now > it will return the @command related instance. > > Signed-off-by: Wenchao Xia > --- > monitor.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/monitor.c b/monitor.c > index 5435dc3..7b752a2 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -3588,6 +3588,9 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon, > if (cmd->sub_table != NULL) { > p1 = p; > /* check if user set additional command */ > + while (qemu_isspace(*p1)) { > + p1++; > + } Is there a reason for this to be in a different patch? I mean, why don't you squash this into the previous patch? Actually, I guess that you could skip the spaces after the search_dispatch_table() call (using p) and drop p1. But please test it before doing so :) Otherwise series looks good to me. > if (*p1 == '\0') { > return cmd; > }