Author: jkeenan Date: Mon Nov 5 03:54:25 2007 New Revision: 22713 Modified: trunk/tools/build/c2str.pl
Log: Applying patch submitted by magnachef in http://rt.perl.org/rt3//Ticket/Display.html?id=46909. Account for escaped quotes in counting number of double quotes in line. Modified: trunk/tools/build/c2str.pl ============================================================================== --- trunk/tools/build/c2str.pl (original) +++ trunk/tools/build/c2str.pl Mon Nov 5 03:54:25 2007 @@ -137,8 +137,8 @@ die "Seen line $line before in $infile - can't continue"; } - # RT#46909 maybe cope with escaped \" - my $cnt = tr/"/"/; + # Find the number of quotes (ignoring escaped quotes) + my $cnt -= scalar (() = $_ =~ /(\\")/g); die "bogus CONST_STRING at line $line" unless $cnt == 2; my $str = extract_delimited; # $_, '"';