zsh-users
 help / color / mirror / code / Atom feed
From: Roman Neuhauser <neuhauser@sigpipe.cz>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-users@zsh.org
Subject: Re: Several PCRE module oddities
Date: Sun, 20 Jul 2014 12:24:09 +0200	[thread overview]
Message-ID: <20140720102409.GS11492@isis.sigpipe.cz> (raw)
In-Reply-To: <140719152116.ZM13686@torch.brasslantern.com>

# schaefer@brasslantern.com / 2014-07-19 15:21:16 -0700:
> -    if (offset_start < 0 || offset_start >= subject_len)
> +    if (offset_start < 0 ||
> +	(subject_len ? offset_start >= subject_len : offset_start > 0))
>  	ret = PCRE_ERROR_NOMATCH;
>      else
>  	ret = pcre_exec(pcre_pattern, pcre_hints, plaintext, subject_len, offset_start, 0, ovec, ovecsize);

maybe the slightly shorter version?

> -    if (offset_start < 0 || offset_start >= (subject_len ? subject_len : 1))

-- 
roman


  parent reply	other threads:[~2014-07-20 10:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-19 12:19 case-insensitivity of =~ operator Moritz Bunkus
2014-07-19 12:31 ` inconsistency in empty argument matching =~/pcre_match Moritz Bunkus
2014-07-19 12:36   ` Moritz Bunkus
2014-07-19 22:21     ` Several PCRE module oddities Bart Schaefer
2014-07-20  7:40       ` Moritz Bunkus
2014-07-20 10:24       ` Roman Neuhauser [this message]
2014-07-20 16:14       ` Bart Schaefer
2014-07-20 17:19         ` Peter Stephenson
2014-07-19 12:36 ` case-insensitivity of =~ operator Moritz Bunkus

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=20140720102409.GS11492@isis.sigpipe.cz \
    --to=neuhauser@sigpipe.cz \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@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).