zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: [patch] Re: UTF-8 and PCRE and metafy
Date: Sun, 23 Oct 2011 17:32:15 +0100	[thread overview]
Message-ID: <20111023173215.0be5ff0d@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20111021095624.GA23272@redoubt.spodhuis.org>

On Fri, 21 Oct 2011 05:56:25 -0400
Phil Pennock <zsh-workers+phil.pennock@spodhuis.org> wrote:
> On 2011-03-08 at 09:58 +0000, Peter Stephenson wrote:
> > On Tue, 8 Mar 2011 01:52:16 -0500
> > Phil Pennock <zsh-workers+phil.pennock@spodhuis.org> 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 <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  parent reply	other threads:[~2011-10-23 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08  6:52 Phil Pennock
2011-03-08  8:19 ` Bart Schaefer
2011-03-08  9:58 ` Peter Stephenson
2011-10-21  9:56   ` [patch] " Phil Pennock
2011-10-21 10:35     ` Phil Pennock
2011-10-23 16:32     ` Peter Stephenson [this message]
2011-10-24 11:35       ` [patch] " Phil Pennock
2011-10-24 11:43         ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111023173215.0be5ff0d@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).