diff options
Diffstat (limited to 'src/lib/libcrypto/util/dirname.pl')
| -rw-r--r-- | src/lib/libcrypto/util/dirname.pl | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/src/lib/libcrypto/util/dirname.pl b/src/lib/libcrypto/util/dirname.pl new file mode 100644 index 0000000000..d7a66d96ac --- /dev/null +++ b/src/lib/libcrypto/util/dirname.pl | |||
| @@ -0,0 +1,18 @@ | |||
| 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); | ||
