From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28241 invoked by alias); 16 Jan 2011 12:26:47 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28630 Received: (qmail 7782 invoked from network); 16 Jan 2011 12:26:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at rzhou.org does not designate permitted sender hosts) Date: Sun, 16 Jan 2011 07:05:20 -0500 From: Ricky Zhou To: zsh-workers@zsh.org Subject: [PATCH] Correct isident false positive. Message-ID: <20110116120519.GA10298@alpha.rzhou.org> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I'm not familiar with with the precise definition of an identifier, so somebody might want to double-check that this change (which assumes that valid identifiers cannot start with a '[') is correct. This fixes the following crash: printf %n '[0]' --- Src/params.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/Src/params.c b/Src/params.c index 8510b92..ba6cd63 100644 --- a/Src/params.c +++ b/Src/params.c @@ -1009,6 +1009,8 @@ isident(char *s) * definitely not a valid identifier. */ if (!*ss) return 1; + if (s =3D=3D ss) + return 0; if (*ss !=3D '[') return 0; =20 --=20 1.7.3.4 --7AUc2qLy4jB3hD7Z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCgAGBQJNMt7/AAoJEAo9eiREaTF2JmAP/jMKIOQWBiFUWScyS6ti5g3u dpXSl19UTTfYSgowHkgbhghm9c9s4fTWYGjK0o03r8CdVbyniaOI6Dh0u5G7ekIz Q68O+gvYoh9gkFqwrNO8HAAPf3pANXndPQTRLq8w09JUzIgLn7hRU+xSLSJnOVzq AK7NxQEUkcwH2gUO/lPi9EDu25+uYwzkxpU6VN8cY5SMABAdlFB8HQ+xvM4A1has 541V8r4cF/ysfJjTaORF66yF5+V1ZDgdwxfGYKpZYbyvaicxntOoBvr2K8CHxYF5 v9fV5aUN9hjRQ6iq9R+aK0Go9dOv6QHc9pZW2m4R7Y5fWOuRqvpCiSk2XK5gFou/ h/9T6UMkf4CrqyCSyQMd2NCIA9N11cNEFm48myKH4p/falhCsEwpADYT9gxTKcso Heh5VwN4xJFUeTwO3B19xROQJS3uD+Ir9iJIFwRl/VUlPBK44yByg7p53U70jngX gW+x6RbBiLYbKr1FYad0OKwQGoNXV5ckRoAdC1/S81S0Nag9PnOiWkVbJatKCZrF XfoiqufCeMso44klyRRT5opkKEm6+An3OVtMSW/BMW/Q+O2lKTSdPF7HIQicYEsH PIUurdpp5GLBIOnhcH2iNObzuOtIAsr0FmRVJ38RY2f76Gt0d97zKzr0RZ/KaU8y YRvjzdbypGMZEWLxNcDp =V9aT -----END PGP SIGNATURE----- --7AUc2qLy4jB3hD7Z--