From patchwork Fri Jan 11 09:14:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [V5,4/6] HMP: filter out space before check of sub-command Date: Thu, 10 Jan 2013 23:14:03 -0000 From: Wayne Xia X-Patchwork-Id: 211253 Message-Id: <1357895645-30359-5-git-send-email-xiawenc@linux.vnet.ibm.com> To: qemu-devel@nongnu.org Cc: Wenchao Xia , aliguori@us.ibm.com, armbru@redhat.com, chenwj@iis.sinica.edu.tw, lcapitulino@redhat.com 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++; + } if (*p1 == '\0') { return cmd; }