X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fpariscid.pl;h=8d21c30dbbc61170cf0802eb1f7924ff51fbe585;hb=a76ce2862bc6ae2cf8a749c8747d371041fc42d1;hp=5a231c49f02a0a8df7a0b85b4f4db04c2d7630f2;hpb=1753d1237429bace72a944f7654ce4b1c4364f60;p=oweals%2Fopenssl.git diff --git a/crypto/pariscid.pl b/crypto/pariscid.pl index 5a231c49f0..8d21c30dbb 100644 --- a/crypto/pariscid.pl +++ b/crypto/pariscid.pl @@ -1,15 +1,18 @@ #! /usr/bin/env perl # Copyright 2009-2018 The OpenSSL Project Authors. All Rights Reserved. # -# Licensed under the OpenSSL license (the "License"). You may not use +# Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # https://www.openssl.org/source/license.html -$flavour = shift; -$output = shift; -open STDOUT,">$output"; +# $output is the last argument if it looks like a file (it has an extension) +# $flavour is the first argument if it doesn't look like a file +$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef; +$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef; + +$output and open STDOUT,">$output"; if ($flavour =~ /64/) { $LEVEL ="2.0W"; @@ -272,5 +275,5 @@ foreach(split("\n",$code)) { print $_,"\n"; } -close STDOUT; +close STDOUT or die "error closing STDOUT";