From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VX6ag-000656-40 for qemu-devel@nongnu.org; Fri, 18 Oct 2013 05:43:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VX6aa-0000mY-5g for qemu-devel@nongnu.org; Fri, 18 Oct 2013 05:43:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VX6aZ-0000mK-SO for qemu-devel@nongnu.org; Fri, 18 Oct 2013 05:43:24 -0400 Message-ID: <526102B4.9010108@redhat.com> Date: Fri, 18 Oct 2013 11:43:16 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1382058681-14957-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1382058681-14957-9-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1382058681-14957-9-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/13] error: don't set sep when print progname List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, lcapitulino@redhat.com Il 18/10/2013 03:11, Wenchao Xia ha scritto: > The behavior to set sep brings trouble to modification later, > the logic is not changed by add tailing space in fprintf(). > > Signed-off-by: Wenchao Xia > --- > util/qemu-error.c | 5 ++--- > 1 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/util/qemu-error.c b/util/qemu-error.c > index 0ccd3e9..d1e858a 100644 > --- a/util/qemu-error.c > +++ b/util/qemu-error.c > @@ -161,8 +161,7 @@ static void error_print_loc(void) > const char *const *argp; > > if (!cur_mon && progname) { > - fprintf(stderr, "%s:", progname); > - sep = " "; > + fprintf(stderr, "%s: ", progname); > } > switch (cur_loc->kind) { > case LOC_CMDLINE: > @@ -181,7 +180,7 @@ static void error_print_loc(void) > error_printf(" "); > break; > default: > - error_printf("%s", sep); > + break; > } > } > > This changes behavior for LOC_FILE. Before: $ cat xyz.cfg [device "abc"] driver = def $ qemu-system-x86_64 -readconfig xyz.cfg qemu-system-x86_64:xyz.cfg:2: parse error After: $ qemu-system-x86_64 -readconfig xyz.cfg qemu-system-x86_64: xyz.cfg:2: parse error Could even be an improvement, but you need to note it in the commit message. Paolo