From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [PATCH] Several PCRE module oddities
Date: Wed, 23 Jul 2014 22:18:21 +0900 [thread overview]
Message-ID: <809CC6B3-5CCA-4D7C-AA4A-96661193917F@kba.biglobe.ne.jp> (raw)
In-Reply-To: <140720095545.ZM20143@torch.brasslantern.com>
On 2014/07/21, at 01:55, Bart Schaefer wrote:
> I was thinking more of using offset_start < 0 as a flag for whether the
> -n option appears at all, since the return value of getposint() can be
> independently examined.
>
> Here's a new patch,
(snip)
> - int offset_start = 0;
> + int offset_start = -1;
(snip)
> - if (offset_start < 0 || offset_start >= subject_len)
> + if (offset_start > 0 && offset_start >= subject_len)
With this patch, if the -n option is not given, then offset_start remains
as -1 and pcre_exec() (line 314)
ret = pcre_exec(pcre_pattern, pcre_hints, plaintext, subject_len, offset_start, 0, ovec, ovecsize);
fails with ret==-24, and V07pcre.ztst fails with errors like
Error output:
(eval):pcre_match:2: error in pcre_exec [-24]
Maybe offset_start can be initialized to 0 as in the original code?
next prev parent reply other threads:[~2014-07-23 13:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140719121937.GN12213@bunkus.org>
[not found] ` <20140719123158.GO12213@bunkus.org>
[not found] ` <20140719123620.GP12213@bunkus.org>
[not found] ` <20140719123645.GQ12213@bunkus.org>
[not found] ` <140719152116.ZM13686@torch.brasslantern.com>
[not found] ` <20140720102409.GS11492@isis.sigpipe.cz>
2014-07-20 16:55 ` [PATCH] " Bart Schaefer
2014-07-23 13:18 ` Jun T. [this message]
2014-07-23 15:26 ` [PATCH] " Bart Schaefer
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=809CC6B3-5CCA-4D7C-AA4A-96661193917F@kba.biglobe.ne.jp \
--to=takimoto-j@kba.biglobe.ne.jp \
--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).