This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
parts/ppptools.pl: Misspelled intended lookbehind assertion
authorKarl Williamson <khw@cpan.org>
Wed, 14 Aug 2019 22:28:33 +0000 (16:28 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:39:29 +0000 (16:39 -0600)
And when I corrected the spelling, I discovered that it would never have
worked if spelled correctly on perls that predate this feature.  So I
used a less efficient loop.

(cherry picked from commit e1584b7d3806e80c64225acc2dd0e4b0ee45196e)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/parts/ppptools.pl

index ba19e22..b6108e2 100644 (file)
@@ -272,11 +272,11 @@ sub trim_arg        # Splits the argument into type and name, returning the
   s/\b(?:auto|extern|inline|register|static|volatile|restrict)\b//g;
   s/\b(?:$remove)\b//;
 
-  s/ (?=<\*) \s+ (?=\*) //xg;   # No spaces in pointer sequences
-  s/ \s* ( \*+ ) \s* / $1 /xg;  # Normalize pointer sequences to be surrounded
-                                # by a single space
-  s/^\s+//; s/\s+$//;           # No leading, trailing spacd
-  s/\s+/ /g;                    # Collapse multiple space into one
+  while (s/ \* \s+ \* /**/xg) {}  # No spaces within pointer sequences
+  s/ \s* ( \*+ ) \s* / $1 /xg;    # Normalize pointer sequences to be surrounded
+                                  # by a single space
+  s/^\s+//; s/\s+$//;             # No leading, trailing spacd
+  s/\s+/ /g;                      # Collapse multiple space into one
 
   return ($_, $name);
 }