yookd / pulledpork

Automatically exported from code.google.com/p/pulledpork
GNU General Public License v2.0
0 stars 0 forks source link

Unmatched [ in regex #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
% perl pulledpork.pl -V
Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ^\];(\t|\s)?/ at 
pulledpork.pl line 987.

Patch

Index: pulledpork.pl
===================================================================
--- pulledpork.pl   (revision 242)
+++ pulledpork.pl   (working copy)
@@ -984,7 +984,7 @@
             ( my $header, my $options ) =
               split( /^[^"]* \(\s*/, $$ruleshash{$k}{$k2}{'rule'} )
               if defined $$ruleshash{$k}{$k2}{'rule'};
-            my @optarray = split( /[^\];(\t|\s)?/, $options ) if $options;
+            my @optarray = split( /\[^\];(\t|\s)?/, $options ) if $options;
             foreach my $option ( reverse(@optarray) ) {
                 my ( $kw, $arg ) = split( /:/, $option ) if $option;
                 if ( $kw && $arg ) {

Tested on Slackware 13.37
perl 5, version 16, subversion 1 (v5.16.1)

% perl pulledpork.pl -V
PulledPork v0.6.2dev the Cigar Pig <////~

Original issue reported on code.google.com by egeektro...@gmail.com on 16 Sep 2012 at 5:02

GoogleCodeExporter commented 9 years ago
I think it should actually be: /[^\\];(\t|\s)?/  will be fixed in next commit

Original comment by Cummin...@gmail.com on 2 Nov 2012 at 4:29

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r243.

Original comment by Cummin...@gmail.com on 2 Nov 2012 at 5:00

GoogleCodeExporter commented 9 years ago
This was still not correct, after chasing down some oddities, this needed to be 
a negative look behind assertion /(?<!\\);(\t|\s)*/

Original comment by Cummin...@gmail.com on 11 Dec 2012 at 3:32