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

Re: Bug report: split splits on wrong pattern

Thread Previous | Thread Next
From:
Abhijit Menon-Sen
Date:
July 2, 2001 04:01
Subject:
Re: Bug report: split splits on wrong pattern
Message ID:
20010702163133.A23186@lustre.dyn.wiw.org
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.

- 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) {

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