From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16555 invoked by alias); 23 Oct 2011 16:32:29 -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: 29843 Received: (qmail 26538 invoked from network); 23 Oct 2011 16:32:27 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: neutral (ns1.primenet.com.au: 74.125.82.171 is neither permitted nor denied by SPF record at ntlworld.com) X-ProxyUser-IP: 86.6.29.42 Date: Sun, 23 Oct 2011 17:32:15 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [patch] Re: UTF-8 and PCRE and metafy Message-ID: <20111023173215.0be5ff0d@pws-pc.ntlworld.com> In-Reply-To: <20111021095624.GA23272@redoubt.spodhuis.org> References: <20110308065216.GB79682@redoubt.spodhuis.org> <20110308095850.12843492@pwslap01u.europe.root.pri> <20111021095624.GA23272@redoubt.spodhuis.org> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 21 Oct 2011 05:56:25 -0400 Phil Pennock wrote: > On 2011-03-08 at 09:58 +0000, Peter Stephenson wrote: > > On Tue, 8 Mar 2011 01:52:16 -0500 > > Phil Pennock wrote: > > > I'm guessing I need a bunch of calls to metafy() to process the > > > results of extraction in zpcre_get_substrings() ? > > > > You'll need to unmetafy any string getting passed into > > pcre_get_substring_list() and metafy() the resulting captures coming > > out. You should duplicate any string that needs unmetafying, since > > otherwise it's in place and you may need the metafied form later (you do > > for the string passed in as the first argument). > > Okay, it took me far too long to get back around to this, sorry. :( > > Attached is what looks to me to be a correct patch. I didn't look through in great detail, so I haven't validated the structure, but certainly what I saw looked fine > I'm not sure on when I should be using the wcs_strdup() functions and > the like; what I've got appears to work. None of what I've added > appears to be specific to UTF-8. You probably don't need wcs_strdup(). When metafied, normals str* functions work because the NULLs are converted to Meta + space; when not metafied you should the length around in a variable and can use mem* functions. > Is it reasonable to add tests to D07multibyte.ztst for this, with the > zsh/pcre dependency? You'd probably need to encapsulate it within a test for loading the library, given which it's probably easier just to copy D07multibyte.ztst and add to the prerequisites a test for loading zsh/pcre at that point, which ought to be easy. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/