From: Aaron Kaplan Date: Sun, 11 Sep 2005 13:33:44 +0000 (-0700) Subject: [perl #37142] h2xs skips enums with negative values X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6329a6bc37759bdf7db227ba0bff23484e9d8b01;p=p5sagit%2Fp5-mst-13.2.git [perl #37142] h2xs skips enums with negative values From: Aaron Kaplan (via RT) Message-ID: p4raw-id: //depot/perl@25388 --- diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 20fa9c3..19452de 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -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;