From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JCgK5-0005qk-2c for qemu-devel@nongnu.org; Wed, 09 Jan 2008 14:10:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JCgK2-0005ni-7X for qemu-devel@nongnu.org; Wed, 09 Jan 2008 14:10:44 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JCgK2-0005nZ-3P for qemu-devel@nongnu.org; Wed, 09 Jan 2008 14:10:42 -0500 Received: from ecfrec.frec.bull.fr ([129.183.4.8]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JCgK1-0003rx-K7 for qemu-devel@nongnu.org; Wed, 09 Jan 2008 14:10:41 -0500 Subject: Re: [Qemu-devel] [PATCH] Fix double backslash problem in Windows From: Laurent Vivier In-Reply-To: <47850A1B.1040200@codemonkey.ws> References: <1199871092.4337.4.camel@frecb07144> <1199873069.4337.20.camel@frecb07144> <1199880481.4337.31.camel@frecb07144> <47850A1B.1040200@codemonkey.ws> Date: Wed, 09 Jan 2008 20:11:07 +0100 Message-Id: <1199905867.4894.1.camel@frecb07144> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-du89Q25rvPRlST0wyb5p" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-du89Q25rvPRlST0wyb5p Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le mercredi 09 janvier 2008 =C3=A0 11:53 -0600, Anthony Liguori a =C3=A9cri= t : > Laurent Vivier wrote: > > Le mercredi 09 janvier 2008 =C3=A0 11:40 +0100, andrzej zaborowski a = =C3=A9crit : > > =20 > >> On 09/01/2008, Laurent Vivier wrote: > >> =20 > >>> Le mercredi 09 janvier 2008 =C3=A0 10:31 +0100, Laurent Vivier a =C3= =A9crit : > >>> =20 > >>>> Le mardi 08 janvier 2008 =C3=A0 17:17 +0100, Herv=C3=A9 Poussineau a= =C3=A9crit : > >>>> =20 > >>>>> Hi, > >>>>> > >>>>> On Windows, since December 2nd, files names provided in command lin= e > >>>>> have to double their backslash to work correctly, for example: "-hd= a > >>>>> c:\\disks\\qemu.qcow" instead of -hda c:\disks\qemu.qcow" > >>>>> This patch removes this need and reverts back to Qemu 0.9.0 behavio= ur > >>>>> > >>>>> Herv=C3=A9 > >>>>> > >>>>> =20 > >>>> I have introduced this behavior to be able to use command line like > >>>> "qemu -hda my\ file", IMHO your patch should be #ifdef for window on= ly. > >>>> =20 > >>> In fact, this is a wrong example, this case is managed by the shell. > >>> A good example is when we have a filename with a '"' in it: > >>> > >>> qemu -hda 2\\\"file > >>> > >>> to open file 2"file > >>> =20 > >> And the correct behaviour for that would be to open the file 2\"file, = while > >> > >> qemu -hda 2\"file > >> > >> should open 2"file. The only character that we may need to handle > >> specially should be the comma, I don't know if anyone cares. > >> =20 > > > > You're right... > > but "-hda" is an alias for "-drive file=3D"%s",index=3D%d,media=3Ddisk"= . > > > > So when you type "qemu -hda 2\"file", > > it becomes "qemu -drive file=3D"2"file",index=3D0,media=3Ddisk" > > which gives filename equal to "2file,index=3D0,media=3Ddisk" instead of > > filename equal to 2"file with option index and media. > > =20 >=20 > The proper solution is to escape the files before doing the snprintf(). What do you call "to escape the files" ? Regards, Laurent --=20 ----------------- Laurent.Vivier@bull.net ------------------ "La perfection est atteinte non quand il ne reste rien =C3=A0 ajouter mais quand il ne reste rien =C3=A0 enlever." Saint Exup=C3=A9ry --=-du89Q25rvPRlST0wyb5p Content-Type: application/pgp-signature; name=signature.asc Content-Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBHhRxL9Kffa9pFVzwRAl3FAJ9QwSG1KqjUtU82YM9Ref+hgaQzWwCfclnm 1MmFnPr/kO5dPDdzS5gRZOc= =IWuT -----END PGP SIGNATURE----- --=-du89Q25rvPRlST0wyb5p--