Skip to content

Commit 5903f67

Browse files
committed
quote_literal PASTHRU_* as can have "" in
1 parent 24fd241 commit 5903f67

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/ExtUtils/MM_Unix.pm

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,9 +2938,14 @@ sub pasthru {
29382938
}
29392939

29402940
foreach my $key (qw(DEFINE INC)) {
2941-
# unconditionally pass through even if not defined in Makefile.PL
2942-
# in case given on make command-line
2943-
push @pasthru, qq{PASTHRU_$key="\$($key) \$(PASTHRU_$key)"};
2941+
# default to the make var
2942+
my $val = qq{\$($key)};
2943+
# expand within perl if given since need to use quote_literal
2944+
# since INC might include space-protecting ""!
2945+
$val = $self->{$key} if defined $self->{$key};
2946+
$val .= " \$(PASTHRU_$key)";
2947+
my $quoted = $self->quote_literal($val);
2948+
push @pasthru, qq{PASTHRU_$key=$quoted};
29442949
}
29452950

29462951
push @m, "\nPASTHRU = ", join ($sep, @pasthru), "\n";

0 commit comments

Comments
 (0)