This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #37142] h2xs skips enums with negative values
authorAaron Kaplan <unknown>
Sun, 11 Sep 2005 13:33:44 +0000 (06:33 -0700)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 12 Sep 2005 14:32:29 +0000 (14:32 +0000)
From: Aaron Kaplan (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.0.11-37142-120585.5.90517066191047@perl.org>

p4raw-id: //depot/perl@25388

utils/h2xs.PL

index 20fa9c3..19452de 100644 (file)
@@ -894,9 +894,8 @@ if( @path_h ){
         # Remove C and C++ comments
         $src =~ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#$2#gs;
 
-        while ($src =~ /(\benum\s*([\w_]*)\s*\{\s([\s\w=,]+)\})/gsc) {
-            my ($enum_name, $enum_body) =
-                $1 =~ /enum\s*([\w_]*)\s*\{\s([\s\w=,]+)\}/gs;
+       while ($src =~ /\benum\s*([\w_]*)\s*\{\s([^}]+)\}/gsc) {
+           my ($enum_name, $enum_body) = ($1, $2);
             # skip enums matching $opt_e
             next if $opt_e && $enum_name =~ /$opt_e/;
             my $val = 0;