From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JCZix-0003vx-Cw for qemu-devel@nongnu.org; Wed, 09 Jan 2008 07:07:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JCZiq-0003tk-Nr for qemu-devel@nongnu.org; Wed, 09 Jan 2008 07:07:58 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JCZiq-0003tP-Cy for qemu-devel@nongnu.org; Wed, 09 Jan 2008 07:07:52 -0500 Received: from ecfrec.frec.bull.fr ([129.183.4.8]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JCZip-0003hp-65 for qemu-devel@nongnu.org; Wed, 09 Jan 2008 07:07:52 -0500 Subject: Re: [Qemu-devel] [PATCH] Fix double backslash problem in Windows From: Laurent Vivier In-Reply-To: References: <1199871092.4337.4.camel@frecb07144> <1199873069.4337.20.camel@frecb07144> Date: Wed, 09 Jan 2008 13:08:01 +0100 Message-Id: <1199880481.4337.31.camel@frecb07144> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-J8HKkGh/MSdgX7EZgnB+" 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 Cc: =?ISO-8859-1?Q?Herv=E9?= Poussineau --=-J8HKkGh/MSdgX7EZgnB+ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le mercredi 09 janvier 2008 =C3=A0 11:40 +0100, andrzej zaborowski a =C3=A9= crit : > On 09/01/2008, Laurent Vivier wrote: > > Le mercredi 09 janvier 2008 =C3=A0 10:31 +0100, Laurent Vivier a =C3=A9= crit : > > > Le mardi 08 janvier 2008 =C3=A0 17:17 +0100, Herv=C3=A9 Poussineau a = =C3=A9crit : > > > > 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 > > > > > > > > > > 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 onl= y. > > > > 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, whi= le >=20 > qemu -hda 2\"file >=20 > 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. 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. So the '\' is needed, and you must have "qemu -hda 2\\\"file" to have "qemu -drive file=3D"2\"file",index=3D0,media=3Ddisk" and then can extract filename to 2"file In the alias, file=3D"%s" is needed to be able to manage filenames with spaces. for instance, if you don't have '"", you will have: qemu -hda "my file" -> qemu -drive file=3Dmy file,index=3D0,media=3Ddisk and thus filename is "my"... > I mean, some characters do need special handling but reimplementing > full escaping logic like in the shell is imho not needed and leads to > typing things like \\\" and forces GUIs to learn the new rules too. > And doesn't justify making unix and ms-windows behaviour different. I totally agree with you, but I didn't find any other solution to manage this. 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 --=-J8HKkGh/MSdgX7EZgnB+ 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) iD8DBQBHhLkh9Kffa9pFVzwRAkNKAKC84b1Ax0+tuQFojd2oWRcUiypzUgCfbP1z h0236ZLfHDLlKSBPsQj2UFs= =S+OM -----END PGP SIGNATURE----- --=-J8HKkGh/MSdgX7EZgnB+--