Re: git: fc002631af3e - main - whereis(1): Respect PORTSDIR variable

From: Enji Cooper (yaneurabeya) <yaneurabeya_at_gmail.com>
Date: Sun, 06 Sep 2026 16:49:24 UTC
Hi Fernando!
	Apologies for not being more explicit when I provided a ship-it earlier in the differential. There was a style(9) bug introduced with the change that should have been fixed pre-commit.
	I’ve highlighted the line below.
Thanks,
-Enji

> On Sep 6, 2026, at 8:28 AM, Fernando Apesteguía <fernape@freebsd.org> wrote:
> 
> The branch main has been updated by fernape:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=fc002631af3e25c65d74ca6869c13b59f1af8689
> 
> commit fc002631af3e25c65d74ca6869c13b59f1af8689
> Author:     Fernando Apesteguía <fernape@FreeBSD.org>
> AuthorDate: 2026-09-04 18:27:34 +0000
> Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
> CommitDate: 2026-09-06 15:25:59 +0000
> 
>    whereis(1): Respect PORTSDIR variable
> 
>    Respect PORTSDIR variable for those who have the ports collection in a different
>    place than /usr/ports. PORTSDIR is a very common variable used in the ports
>    framework and in /etc/make.conf among other places.
> 
>    While here, remove and old reference to CVS.
> 
>    Reviewed by:    delphij@, ngie@
>    Approved by:    ngie@
>    Differential Revision:  https://reviews.freebsd.org/D42156
> ---
> usr.bin/whereis/whereis.1 |  4 +++-
> usr.bin/whereis/whereis.c | 38 +++++++++++++++++++++-----------------
> 2 files changed, 24 insertions(+), 18 deletions(-)

…

> -		if (stat(PATH_PORTS, &sb) == -1) {
> +		path_ports = getenv("PORTSDIR");
> +		if (!path_ports)

style(9): C code should test for `== NULL`, not boolean false.