Fix init_thread_stop
[openssl.git] / crypto / pariscid.pl
index 47fdce9513b80a5a9563c9fdb1dcb5c3d4bea94d..aafcb2a9bc3b06f35c79832eedbce025345936e2 100644 (file)
@@ -7,9 +7,12 @@
 # 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";