Re: [PATCH] Re: INSTALLSCRIPT versus INSTALLDIRS
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / Constant.pm
index 46021b0..c449a9b 100644 (file)
@@ -243,17 +243,23 @@ EOT
   $xs .= ', &sv' if $params->{SV};
   $xs .= ");\n";
 
+  # If anyone is insane enough to suggest a package name containing %
+  my $package_sprintf_safe = $package;
+  $package_sprintf_safe =~ s/%/%%/g;
+
   $xs .= << "EOT";
       /* Return 1 or 2 items. First is error message, or undef if no error.
            Second, if present, is found value */
         switch (type) {
         case PERL_constant_NOTFOUND:
-          sv = sv_2mortal(newSVpvf("%s is not a valid $package macro", s));
+          sv =
+           sv_2mortal(newSVpvf("%s is not a valid $package_sprintf_safe macro", s));
           PUSHs(sv);
           break;
         case PERL_constant_NOTDEF:
           sv = sv_2mortal(newSVpvf(
-           "Your vendor has not defined $package macro %s, used", s));
+           "Your vendor has not defined $package_sprintf_safe macro %s, used",
+                                  s));
           PUSHs(sv);
           break;
 EOT
@@ -283,7 +289,7 @@ EOT
   $xs .= << "EOT";
         default:
           sv = sv_2mortal(newSVpvf(
-           "Unexpected return type %d while processing $package macro %s, used",
+           "Unexpected return type %d while processing $package_sprintf_safe macro %s, used",
                type, s));
           PUSHs(sv);
         }
@@ -513,16 +519,9 @@ sub WriteConstants {
   
   if ($ARGS{PROXYSUBS}) {
       require ExtUtils::Constant::ProxySubs;
-      ExtUtils::Constant::ProxySubs->WriteConstants({c_fh => $c_fh,
-                                                    xs_fh => $xs_fh,
-                                                    package => $ARGS{NAME},
-                                                    c_subname
-                                                    => $ARGS{C_SUBNAME},
-                                                    xs_subname
-                                                    => $ARGS{XS_SUBNAME},
-                                                    default_type
-                                                    => $ARGS{DEFAULT_TYPE},
-                                                   }, @{$ARGS{NAMES}});
+      $ARGS{C_FH} = $c_fh;
+      $ARGS{XS_FH} = $xs_fh;
+      ExtUtils::Constant::ProxySubs->WriteConstants(%ARGS);
   } else {
       my $types = {};