]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - crypto/openssl/util/dirname.pl
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / crypto / openssl / util / dirname.pl
1 #!/usr/local/bin/perl
2
3 if ($#ARGV < 0) {
4     die "dirname.pl: too few arguments\n";
5 } elsif ($#ARGV > 0) {
6     die "dirname.pl: too many arguments\n";
7 }
8
9 my $d = $ARGV[0];
10
11 if ($d =~ m|.*/.*|) {
12     $d =~ s|/[^/]*$||;
13 } else {
14     $d = ".";
15 }
16
17 print $d,"\n";
18 exit(0);