Date: Thu, 12 Oct 2000 07:40:02 -0700 (PDT) From: ak03@gte.com (Alexander N. Kabaev) To: freebsd-bugs@FreeBSD.org Subject: Re: bin/21918: Unjustified basename code removal and subsequent breakage Message-ID: <200010121440.HAA29911@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/21918; it has been noted by GNATS.
From: ak03@gte.com (Alexander N. Kabaev)
To: Dag-Erling Smorgrav <des@ofug.org>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/21918: Unjustified basename code removal and subsequent breakage
Date: 12 Oct 2000 10:33:41 -0400
> Why do you use 16 lines of code to fix this when all you need is to
> add p != q to the if test?
I just restored the code you removed in revision 1.4. It is of
course the matter of personal preference, but the old code IMO
is much more readable than the && chain you added in recently.
Feel free to apply your patch if you really like it better.
6 out of 16 lines of my patch are the comment anyway, so it is not
_that_ bad :)
>(And you didn't spot the real bug, either - but it can still be
> fixed by just rewording the if test)
Do you mean the basename(1) and basename(3) inconsistency described
in Bruse Evans message? Or there is something else I am missing?
Should we add something like the following to make FreeBSD basename
consistent with historic behaviour again?
/*
* Do not call basename(3) with an empty string because
* basename(3) is specified to bogotify
* this case by changing "" to "." and that is
* not consistent with what basename(1) is supposed to do
*/
if ( argv[0][0]) == '\0') {
(void)printf("\n");
exit(0);
}
P.S. All English grammar errors in the above text are mine and
mine only.
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010121440.HAA29911>
