Received: from [140.186.70.92] (port=57449 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0wS7-0001Aa-EN for qemu-devel@nongnu.org; Sat, 19 Mar 2011 09:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0wS5-0003Xf-Sf for qemu-devel@nongnu.org; Sat, 19 Mar 2011 09:44:23 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:34029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0wS5-0003XL-Ma for qemu-devel@nongnu.org; Sat, 19 Mar 2011 09:44:21 -0400 Message-Id: <3EE691CA-0F3E-4463-AE1F-06C69DD56FCD@web.de> From: =?ISO-8859-1?Q?Andreas_F=E4rber?= In-Reply-To: <1300195102-52156-1-git-send-email-gingold@adacore.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Qemu-devel] [PATCH] cocoa: do not create a spurious window for -version Date: Sat, 19 Mar 2011 14:44:17 +0100 References: <1300195102-52156-1-git-send-email-gingold@adacore.com> Sender: andreas.faerber@web.de List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tristan Gingold Cc: qemu-devel@nongnu.org Hello Tristan, Am 15.03.2011 um 14:18 schrieb Tristan Gingold: > When invoked with -version, qemu will exit just after displaying the > version, > so there is no need to create a window. > Also handles --XXX options. > > Signed-off-by: Tristan Gingold Looks good to me except for the qemu_main() indentation. Should I fix it and enqueue it on my cocoa branch for the next pull? Just wondering, since when do we support -- options? Andreas > --- > ui/cocoa.m | 15 ++++++++++++--- > 1 files changed, 12 insertions(+), 3 deletions(-) > > diff --git a/ui/cocoa.m b/ui/cocoa.m > index 20f91bc..1ff1ac6 100644 > --- a/ui/cocoa.m > +++ b/ui/cocoa.m > @@ -865,10 +865,19 @@ int main (int argc, const char * argv[]) { > > /* In case we don't need to display a window, let's not do that */ > for (i = 1; i < argc; i++) { > - if (!strcmp(argv[i], "-vnc") || > - !strcmp(argv[i], "-nographic") || > - !strcmp(argv[i], "-curses")) { > + const char *opt = argv[i]; > + > + if (opt[0] == '-') { > + /* Treat --foo the same as -foo. */ > + if (opt[1] == '-') { > + opt++; > + } > + if (!strcmp(opt, "-vnc") || > + !strcmp(opt, "-nographic") || > + !strcmp(opt, "-version") || > + !strcmp(opt, "-curses")) { > return qemu_main(gArgc, gArgv); > + } > } > } > > -- > 1.7.3.GIT > >