our $VERSION;
BEGIN {
- $VERSION = '3.27';
+ $VERSION = '3.33';
}
use ExtUtils::ParseXS::Constants $VERSION;
use ExtUtils::ParseXS::CountLines $VERSION;
} );
}
else {
- print "\t$class *";
+ print "\t" . map_type($self, "$class *");
$self->{var_types}->{"THIS"} = "$class *";
$self->generate_init( {
type => "$class *",
var => $_,
do_setmagic => $self->{DoSetMagic},
do_push => undef,
- } ) for grep $self->{in_out}->{$_} =~ /OUT$/, keys %{ $self->{in_out} };
+ } ) for grep $self->{in_out}->{$_} =~ /OUT$/, sort keys %{ $self->{in_out} };
my $prepush_done;
# all OUTPUT done, so now push the return value on the stack
return join (' ', ($cmd, @args));
}
+# code copied from CPAN::HandleConfig::safe_quote
+# - that has doc saying leave if start/finish with same quote, but no code
+# given text, will conditionally quote it to protect from shell
+{
+ my ($quote, $use_quote) = $^O eq 'MSWin32'
+ ? (q{"}, q{"})
+ : (q{"'}, q{'});
+ sub _safe_quote {
+ my ($self, $command) = @_;
+ # Set up quote/default quote
+ if (defined($command)
+ and $command =~ /\s/
+ and $command !~ /[$quote]/) {
+ return qq{$use_quote$command$use_quote}
+ }
+ return $command;
+ }
+}
+
sub INCLUDE_COMMAND_handler {
my $self = shift;
$_ = shift;
# If $^X is used in INCLUDE_COMMAND, we know it's supposed to be
# the same perl interpreter as we're currently running
- s/^\s*\$\^X/$^X/;
+ my $X = $self->_safe_quote($^X); # quotes if has spaces
+ s/^\s*\$\^X/$X/;
# open the new file
open ($self->{FH}, "-|", $_)