summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2002-09-05 22:45:01 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2002-09-05 22:45:01 +0000
commitbfd6188e26175478899b35f39b00ee6c3e967efe (patch)
tree06698a7728cb50df3379d5e794dafe40555018e7 /lib/libcrypto
parentbf89ad4321ebfd31b01ca2f89e6b00d8eeb96797 (diff)
import openssl-0.9.7-beta3
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/util/dirname.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/libcrypto/util/dirname.pl b/lib/libcrypto/util/dirname.pl
new file mode 100644
index 00000000000..d7a66d96acc
--- /dev/null
+++ b/lib/libcrypto/util/dirname.pl
@@ -0,0 +1,18 @@
+#!/usr/local/bin/perl
+
+if ($#ARGV < 0) {
+ die "dirname.pl: too few arguments\n";
+} elsif ($#ARGV > 0) {
+ die "dirname.pl: too many arguments\n";
+}
+
+my $d = $ARGV[0];
+
+if ($d =~ m|.*/.*|) {
+ $d =~ s|/[^/]*$||;
+} else {
+ $d = ".";
+}
+
+print $d,"\n";
+exit(0);