summaryrefslogtreecommitdiffstats
path: root/usr.bin/whereis
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-12-23 18:55:32 +0000
committerjoerg <joerg@FreeBSD.org>1996-12-23 18:55:32 +0000
commitb4b3d5f49ef9be843000a19fb455ade258f35b7e (patch)
tree0b3d36ea32a343e32b0f2090feda88c92b5e91d0 /usr.bin/whereis
parent60c5bef91705534fc7d9fb80ceefddf5accb7fb3 (diff)
downloadFreeBSD-src-b4b3d5f49ef9be843000a19fb455ade258f35b7e.zip
FreeBSD-src-b4b3d5f49ef9be843000a19fb455ade258f35b7e.tar.gz
Fix a logico that sneaked into the manpath handling.
Turn off error messages from locate(1), we can't do very much about its database not being ok anyway at this time. Closes PR # bin/2183: whereis returns environ...
Diffstat (limited to 'usr.bin/whereis')
-rw-r--r--usr.bin/whereis/whereis.pl8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/whereis/whereis.pl b/usr.bin/whereis/whereis.pl
index 2f4e9db..520c3d4 100644
--- a/usr.bin/whereis/whereis.pl
+++ b/usr.bin/whereis/whereis.pl
@@ -28,7 +28,7 @@
#
# Rewritten from scratch for FreeBSD after the 4.3BSD manual page.
#
-# $Id$
+# $Id: whereis.pl,v 1.1 1996/06/15 12:29:48 joerg Exp $
#
sub usage
@@ -117,13 +117,15 @@ if (!defined(@manuals)) {
#
# first, use default manpath, then append user's $MANPATH
#
+ local($usermanpath) = $ENV{'MANPATH'};
+ delete $ENV{'MANPATH'};
local($manpath) = `/usr/bin/manpath`;
local(@list, %path, $i);
chop($manpath);
@list = &decolonify($manpath);
- push(@list, &decolonify($ENV{'MANPATH'}));
+ push(@list, &decolonify($usermanpath));
# remove duplicates
foreach (@list) {
@@ -220,7 +222,7 @@ foreach $name (@names) {
# source directories, and at least one further level of
# subdirectories.
#
- if (!$found && open(LOCATE, "locate */$name|")) {
+ if (!$found && open(LOCATE, "locate */$name 2>/dev/null |")) {
locate_item:
while (chop($loc = <LOCATE>)) {
foreach (@sources) {
OpenPOWER on IntegriCloud