diff options
| author | Wolfgang Helbig <helbig@FreeBSD.org> | 1998-01-02 13:46:25 +0000 |
|---|---|---|
| committer | Wolfgang Helbig <helbig@FreeBSD.org> | 1998-01-02 13:46:25 +0000 |
| commit | 9fe1b8ebb8a602ff8aa6cab34ca518a4123ba362 (patch) | |
| tree | 87208578e8147c60374e692fa25a7c9f51571584 /usr.bin/which | |
| parent | 53922aaf1840776554c542d06a9d1efed1128a9f (diff) | |
Notes
Diffstat (limited to 'usr.bin/which')
| -rwxr-xr-x | usr.bin/which/which.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/which/which.pl b/usr.bin/which/which.pl index 2def134cc2916..688eb6add1a96 100755 --- a/usr.bin/which/which.pl +++ b/usr.bin/which/which.pl @@ -24,10 +24,14 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: which.pl,v 1.10 1997/02/22 19:57:51 peter Exp $ +# $Id: which.pl,v 1.11 1997/08/26 11:13:39 charnier Exp $ $all = $silent = $found = 0; @path = split(/:/, $ENV{'PATH'}); +if ($ENV{'PATH'} =~ /:$/) { + $#path = $#path + 1; + $path[$#path] = ""; +} if ($ARGV[0] eq "-a") { $all = 1; shift @ARGV; @@ -43,6 +47,7 @@ foreach $prog (@ARGV) { $found = 1; } else { foreach $e (@path) { + $e = "." if !$e; if (-x "$e/$prog") { print "$e/$prog\n" unless $silent; $found = 1; |
