From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8YZy-0002oM-0N for qemu-devel@nongnu.org; Fri, 16 Mar 2012 10:56:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8YZr-0007GQ-IX for qemu-devel@nongnu.org; Fri, 16 Mar 2012 10:56:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8YZr-0007GC-AK for qemu-devel@nongnu.org; Fri, 16 Mar 2012 10:56:23 -0400 Message-ID: <4F635494.30208@redhat.com> Date: Fri, 16 Mar 2012 08:56:20 -0600 From: Eric Blake MIME-Version: 1.0 References: <541C8B7E-1E25-479E-B69E-A4B58BFA45F3@nowonline.co.uk> <4F633DA0.2090900@redhat.com> In-Reply-To: <4F633DA0.2090900@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigE98D8DF01975C50F1EE4AAFD" Subject: Re: [Qemu-devel] [PATCH] fix incorrect bracket in tracetool List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Lee Essen , =?ISO-8859-1?Q?Andreas_F=E4rber?= , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE98D8DF01975C50F1EE4AAFD Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 03/16/2012 07:18 AM, Paolo Bonzini wrote: > Il 16/03/2012 13:29, Lee Essen ha scritto: >> @@ -123,7 +123,7 @@ get_argc() >> # Get the format string including double quotes for a trace event >> get_fmt() >> { >> - puts "${1#*)}" This says to call puts with the first argument of get_fmt, except with the shortest prefix ending in ) omitted. Or are you complaining that there is a shell treating this as a syntax error? >> + puts "${1#*}" This says to omit the shortest prefix that matches the glob '*', but that is always the empty string, so you might as well write it "$1". >> } >> =20 >=20 > Eric, can you look at this? Is it a bashism or a Solaris bug? Solaris /bin/sh lacks support for ${var#pattern}, but POSIX requires it. If this is using #!/bin/sh, you aren't portable. >=20 > I would write it, to be entirely safe, as >=20 > local fmt local is not portable. > fmt=3D${1#*\)} > puts "$fmt" This looks reasonable, if you were hitting syntax errors on an unquoted ), and if you are sure that you have a POSIX rather than Solaris /bin/sh.= >=20 > where I'm using the extra variable to avoid the ambiguity of quoting th= e > parentheses within quotes; variable assignments are always implicitly > quoted. >=20 > Paolo >=20 --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigE98D8DF01975C50F1EE4AAFD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPY1SUAAoJEKeha0olJ0Nqa7gH/3boT7vrzA6HanDA8RMLxDbr 7NPALhQDOZCDXexElv+fEwOfVZok7Cg4XlBMpRI20tVwEj1WfPFkUe7cKLd/Ea8D motS7lUmX7ozsRXv/EO0GGELTtpWzE+tYvHI2DTcfWOKDHMHu/OhN2SuEgOIpfyA 3vSTkGzL1K2jE16GGWCny9s8cr2UtZ4Xbn9JZE3oNcz2oJ8V5pxaHCuNzmqnZBoc i7S9vqJTCr6BaOvHjmPoLJFLX4DGIuQNQGDTMa1idBMghKbBSLcigoWdre6isnwy kpPA54GYFBBVilMo7NGS1GJHx4+B5v/9lalytaFnB7G8Z8CuMI6IDvDyCWYEsNQ= =I5kV -----END PGP SIGNATURE----- --------------enigE98D8DF01975C50F1EE4AAFD--