From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24168 invoked by alias); 8 Sep 2016 13:56:17 -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: 39239 Received: (qmail 11548 invoked from network); 8 Sep 2016 13:56:17 -0000 X-Qmail-Scanner-Diagnostics: from mx.spodhuis.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(94.142.241.89):SA:0(-1.1/5.0):. Processed in 1.214216 secs); 08 Sep 2016 13:56:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=RP_MATCHES_RCVD,SPF_PASS, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: zsh-workers+phil.pennock@spodhuis.org X-Qmail-Scanner-Mime-Attachments: |signature.asc| X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spodhuis.org designates 94.142.241.89 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201608; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:To:From:Date; bh=cI9hkx4RG9Pt+kekKmrG39fkSo78aNYlDfipOaYAstc=; b=uWjRDcrMyjcm+lm/Nw+Px+xted 7z4hIYTt5SzeP+a9TTNDHHu8hD53pQK+RMoxtIhtIgC6LLKbhFYy+0xHMQfT2kv8fte0OlKeYXg0x iS0PblyQvgndFrEa9iFmlv7XkKpQifP2q5IiLxSVGKfGuvmI7LtIzXULYp7NkEUmf6dHVhcQtSVYu eeFnQieglyZEuB5kFR1Arp8x9eIj; Date: Thu, 8 Sep 2016 09:56:00 -0400 From: Phil Pennock To: zsh-workers@zsh.org Subject: [PATCH] re2: fix clean-up path; fix two comments Message-ID: <20160908135559.GA10762@breadbox.private.spodhuis.org> Mail-Followup-To: zsh-workers@zsh.org References: <20160908041556.GA8401@breadbox.private.spodhuis.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline In-Reply-To: <20160908041556.GA8401@breadbox.private.spodhuis.org> OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/0x4D1E900E14C1CC04.asc --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2016-09-08 at 00:15 -0400, Phil Pennock wrote: > I've also pushed this code to a GitHub repo, philpennock/zsh-code on the > re2 branch: https://github.com/philpennock/zsh-code/tree/re2 This change is there too. > (Oh, I can't spell "tough", it seems; deferring fix for now). Fixed. Also fixed a bug described just below in the patch body, and swapped a FIXME comment for a TODO, referencing whatever future work changes =3D~ binding. (Feedback on that idea, outlined in previous mail, appreciated!) -Phil ----------------------------8< git patch >8----------------------------- The clean-up path is for an internal function being passed an id which it can't handle, but the ids come from this file, so it's protection against coding mistakes in future extension. In that hypothetical case, we'd leak the memory of one RE2 opt object each time the matching function was called in the unhandled id-profile. Also clean up two comments. --- Src/Modules/re2.c | 4 ++-- Test/V11re2.ztst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/Modules/re2.c b/Src/Modules/re2.c index e542723..f6a5283 100644 --- a/Src/Modules/re2.c +++ b/Src/Modules/re2.c @@ -28,7 +28,7 @@ */ =20 /* This is heavily based upon my earlier regex module, with Peter's fixes - * for the tought stuff I had skipped / gotten wrong. */ + * for the tougher stuff I had skipped / gotten wrong. */ =20 #include "re2.mdh" #include "re2.pro" @@ -106,7 +106,7 @@ zcond_re2_match(char **a, int id) break; default: DPUTS(1, "bad re2 option"); - goto CLEANUP_UNMETAONLY; + goto CLEANUP_OPT; } =20 rex =3D cre2_new(rhre, strlen(rhre), opt); diff --git a/Test/V11re2.ztst b/Test/V11re2.ztst index d6e327c..823a5ef 100644 --- a/Test/V11re2.ztst +++ b/Test/V11re2.ztst @@ -7,7 +7,7 @@ fi # Load the rest of the builtins zmodload zsh/re2 - ##FIXME#setopt rematch_pcre + # TODO: use future mechanism to switch =3D~ to use re2 and test =3D~ too # Find a UTF-8 locale. setopt multibyte # Don't let LC_* override our choice of locale. --=20 2.10.0 --fUYQa+Pmc3FrFX/N Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJX0W3fAAoJEBPa2Zx+QVGcks8P/jMqWBrjTEcFUArAFwOGsfoI QScEbePq9lcCoSvC6FZn40x1EBa81naMwpWeKvn/2WzHc2hQhyZRwHEVUNrS2SMO uGkk48mc5fJo0APp6IyonkSp30MsLqBdkDHRQup4CgbW9Pm2ywxp9I+9L0nB0d1Q D/riCx4x3YEZg+pb/lhBUIfSNHSw58k6RPiGqBAd806pZxzjTPbVcl1nL4jLA69E QvFRW9lj4pL4aka9IlHxwSoZPGra3sEdQP5MxMpNvlL4pczJEGyrFdwfsypkE7kD webJU1epIqVXDhKdfvVWyySILYLjU0iXIGJdY9dVa+6sNFVkW+b4KcyxjPB3CcZd hvd68DXkrck9cQ4bx4rzyWpkYHYkjUdBjtIpyPK514zo+J0kGR837SGa3w+FJl/p vsaq7ZJMYNkRzIrQUa0BtFR8z8sgWqeImJKGOkoSbEVhidWQGhjcgRwtqI8IDuNG O+duWfqdAZfwKTv4NT7jTAO8oMM/BkfInnVfEmp+rywXTqrMrFb8HGdG9uK68cug 36NofpwBP5txeQ4tE/739yECUwkxTEzFL8OX6i9xrB/WwFHXMrB69k4YYn1fusdf uDXv8M8+eKUWazINYg3b406VMEKtaabMAfOe7s5yV5FfvCsSpOfms9MVrIkE9l8t 2/MyV/ZsA57VZdncBij+ =+M+t -----END PGP SIGNATURE----- --fUYQa+Pmc3FrFX/N--