summaryrefslogtreecommitdiffstats
path: root/Configure
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-02-25 00:17:59 +0100
committerRichard Levitte <levitte@openssl.org>2016-02-26 09:00:25 +0100
commitbdcd83e1272c84f3de576f793ba03fdc2c21a557 (patch)
treece1ce0e41c8e414192c5c8366fc14f8e59bb4a36 /Configure
parent9666ffb33321ea9a5ef166d3a297bb46e40e587e (diff)
Configure - neater looking add() and add_before()
They now default to " " as separator, but that can be overridden by having a hash with parameters as last argument. The only currently recognised parameter is `separator'. The special separator `undef' will force the result to become a list rather than a concatenated string. Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure12
1 files changed, 10 insertions, 2 deletions
diff --git a/Configure b/Configure
index b6c8d8ce6c..ad20bf6288 100755
--- a/Configure
+++ b/Configure
@@ -1970,12 +1970,20 @@ sub _add {
}
}
sub add_before {
- my $separator = shift;
+ my $separator = " ";
+ if (ref($_[$#_]) eq "HASH") {
+ my $opts = pop;
+ $separator = $opts->{separator};
+ }
my @x = @_;
sub { _add($separator, @x, @_) };
}
sub add {
- my $separator = shift;
+ my $separator = " ";
+ if (ref($_[$#_]) eq "HASH") {
+ my $opts = pop;
+ $separator = $opts->{separator};
+ }
my @x = @_;
sub { _add($separator, @_, @x) };
}