From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21865 invoked by alias); 22 Jun 2015 16:29:19 -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: 35566 Received: (qmail 14225 invoked from network); 22 Jun 2015 16:29:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f5-f794b6d000001495-eb-558837d98e38 Date: Mon, 22 Jun 2015 17:29:09 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Strange behavior of [[ Message-id: <20150622172909.2549fb29@pwslap01u.europe.root.pri> In-reply-to: <55883016.1080103@googlemail.com> References: <5577AE8F.6060902@arthaud.me> <150609223156.ZM29890@torch.brasslantern.com> <20150610095521.35e3e4e9@pwslap01u.europe.root.pri> <20150611175912.17d1823c@pwslap01u.europe.root.pri> <55883016.1080103@googlemail.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsVy+t/xa7o3zTtCDeZP5bY42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGbvWHWIpWMhV8W5+F1MD40f2LkYODgkBE4nF9yq7GDmBTDGJ C/fWs3UxcnEICSxllDh4ah0jhDODSeLbzw5WCGcbo0RHzz0WkBYWAVWJro4l7CA2m4ChxNRN sxlBbBEBcYmza8+D1QgLKEs8u3mTDcTmFbCXOLFgAZjNKaAnsXX5aXaIoS8ZJZ7d28cKkuAX 0Je4+vcTE8RN9hIzr5xhhGgWlPgxGWIxs4CWxOZtTawQtrzE5jVvmUFsIQF1iRt3d7NPYBSa haRlFpKWWUhaFjAyr2IUTS1NLihOSs810itOzC0uzUvXS87P3cQICduvOxiXHrM6xCjAwajE wzvDvj1UiDWxrLgy9xCjBAezkghvy1mgEG9KYmVValF+fFFpTmrxIUZpDhYlcd6Zu96HCAmk J5akZqemFqQWwWSZODilGhhvla0IVDrV9/7U68NvDNN+nW4NquHM8Us73J+7ZRPXuoqwKpue fZo2TdOVp1mKflPdv2JOKdfTuckdK99Pc+9WCGoxPx0Ufln2dcqd8EppdV1PhSOSMSk223qe sjZrH1/n94DX+6eh06ZyNtajs9dw7nGP/vBxv+JuK/smFp5mNUFrpQ27TymxFGckGmoxFxUn AgCp7fKlVwIAAA== On Mon, 22 Jun 2015 17:56:06 +0200 m0viefreak wrote: > On 11.06.2015 18:59, Peter Stephenson wrote: > > The change from mb_metacharinit() to mb_charinit() is a bit unsightly > > but the name had got just plain confusing --- there's nothing meta about > > it. I never metacharacter I couldn't parse. > > > > (No multibyte characters were harmed in the preparation of this email; > > I've used $'\ua0'.) > > > > pws > > > > > > ... > > > > This patch (f1923bdfa6300a0d32e3329eb2488447f76b8970) introduces another > issue for me: > > Regex evaluation using a conditional capture group crashes zsh when the > pattern is not found: This isn't fundamentally new, it's just a different response to an unhandled condition. -1 is consistent with what glob matches do. pws diff --git a/Src/Modules/regex.c b/Src/Modules/regex.c index 94f523f..16cc77f 100644 --- a/Src/Modules/regex.c +++ b/Src/Modules/regex.c @@ -155,6 +155,11 @@ zcond_regex_match(char **a, int id) ++n, ++m, ++bptr, ++eptr) { char buf[DIGBUFSIZE]; + if (m->rm_so < 0 || m->rm_eo < 0) { + *bptr = ztrdup("-1"); + *eptr = ztrdup("-1"); + continue; + } ptr = lhstr; leftlen = m->rm_so; offs = 0;