regen/regcharclass.pl: Generate correct macro instead of skipping
authorKarl Williamson <public@khwilliamson.com>
Tue, 11 Mar 2014 21:47:53 +0000 (15:47 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 12 Mar 2014 19:27:55 +0000 (13:27 -0600)
It makes no sense to check for length safeness for The macros generated
by this program which take a single UV code point as a parameter. Prior
to this patch, it would skip trying to generate them if asked.  But,
because of the way things are structured, that means that if you need
just this and the safe versions, you can't do it so easily.  What this
commit does is generate the cp macro if requested even if the 'safe'
version of other macros are also requested.

regen/regcharclass.pl

index 5b794ea..c62d31d 100755 (executable)
@@ -1389,12 +1389,11 @@ EOF
             my ( $type, $ret )= split /-/, $type_spec;
             $ret ||= 'len';
             foreach my $mod ( @mods ) {
-                next if $mod eq 'safe' and $type =~ /^cp/;
                 delete $mods{$mod};
                 my $macro= $obj->make_macro(
                     type     => $type,
                     ret_type => $ret,
-                    safe     => $mod eq 'safe'
+                    safe     => $mod eq 'safe' && $type !~ /^cp/,
                 );
                 print $out_fh $macro, "\n";
             }