The strings we expand contain other variable references than just
${MACHINE}. Instead of having to remember what to expand, we simply
evaluate the string as a, well, string.
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11230)
-# Expand variable references in a string.
-sub expand {
- my $var = shift;
- $var =~ s/\$\{MACHINE\}/${MACHINE}/;
- return $var;
-}
-
# Look for ISC/SCO with its unique uname program
sub is_sco_uname {
open UNAME, "uname -X 2>/dev/null|" or return '';
# Look for ISC/SCO with its unique uname program
sub is_sco_uname {
open UNAME, "uname -X 2>/dev/null|" or return '';
my $REL = is_sco_uname();
if ( $REL ne "" ) {
my $result = get_sco_type($REL);
my $REL = is_sco_uname();
if ( $REL ne "" ) {
my $result = get_sco_type($REL);
- return expand($result) if $result ne '';
+ return eval "\"$result\"" if $result ne '';
# Trailing $ omitted on purpose.
next if $sys !~ /^$pat/;
my $result = @$tuple[1];
# Trailing $ omitted on purpose.
next if $sys !~ /^$pat/;
my $result = @$tuple[1];
- return expand($result);
+ return eval "\"$result\"";
next if $sys !~ /^$pat/;
my $ref = @$tuple[1];
my $result = &$ref;
next if $sys !~ /^$pat/;
my $ref = @$tuple[1];
my $result = &$ref;
- return expand($result);
+ return eval "\"$result\"";