From 52261db09ef9dbf5abc95baed22722c5c332f9f7 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 20 Jun 2006 17:33:26 +0000 Subject: Pulling OpenSSL 0.9.8b into trunk svn path=/openssl/trunk; revision=3 --- openssl/trunk/util/dirname.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 openssl/trunk/util/dirname.pl (limited to 'openssl/trunk/util/dirname.pl') diff --git a/openssl/trunk/util/dirname.pl b/openssl/trunk/util/dirname.pl new file mode 100644 index 00000000..d7a66d96 --- /dev/null +++ b/openssl/trunk/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); -- cgit v1.2.3