develooper Front page | perl.perl5.porters | Postings from July 2001

Re: Bug report: split splits on wrong pattern

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
July 2, 2001 12:25
Subject:
Re: Bug report: split splits on wrong pattern
Message ID:
20010702142509.S19034@chaos.wustl.edu
On Mon, Jul 02, 2001 at 04:31:33PM +0530, Abhijit Menon-Sen wrote:
> At 2001-06-27 21:50:52, radu@netsoft.ro wrote:
> >
> > --- pp_ctl.c~	Tue Jun 26 16:29:51 2001
> > +++ pp_ctl.c	Wed Jun 27 21:14:35 2001
> > @@ -147,8 +147,11 @@
> >  
> >      if (!PM_GETRE(pm)->prelen && PL_curpm)
> >  	pm = PL_curpm;
> > -    else if (strEQ("\\s+", PM_GETRE(pm)->precomp))
> > -	pm->op_pmflags |= PMf_WHITE;
> > +    else
> > +	if (strEQ("\\s+", PM_GETRE(pm)->precomp))
> > +	    pm->op_pmflags |= PMf_WHITE;
> > +	else
> > +	    pm->op_pmflags &= ~PMf_WHITE;
> 
> That's very misleading indentation: the last else goes with the first
> if. I suggest the following (additional) change.

Thanks, applied.  (Personally, I prefer sprinking of extra curlies
instead of relying on indentation.)

> - ams
> 
> --- current/pp_ctl.c~	Mon Jul  2 16:07:16 2001
> +++ current/pp_ctl.c	Mon Jul  2 16:12:39 2001
> @@ -147,11 +147,10 @@
>  
>      if (!PM_GETRE(pm)->prelen && PL_curpm)
>  	pm = PL_curpm;
> +    else if (strEQ("\\s+", PM_GETRE(pm)->precomp))
> +	pm->op_pmflags |= PMf_WHITE;
>      else
> -	if (strEQ("\\s+", PM_GETRE(pm)->precomp))
> -	    pm->op_pmflags |= PMf_WHITE;
> -	else
> -	    pm->op_pmflags &= ~PMf_WHITE;
> +	pm->op_pmflags &= ~PMf_WHITE;
>  
>      /* XXX runtime compiled output needs to move to the pad */
>      if (pm->op_pmflags & PMf_KEEP) {

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About