From owner-freebsd-bugs Thu Oct 12 7:40: 6 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7F77137B502 for ; Thu, 12 Oct 2000 07:40:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id HAA29911; Thu, 12 Oct 2000 07:40:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Thu, 12 Oct 2000 07:40:02 -0700 (PDT) Message-Id: <200010121440.HAA29911@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: ak03@gte.com (Alexander N. Kabaev) Subject: Re: bin/21918: Unjustified basename code removal and subsequent breakage Reply-To: ak03@gte.com (Alexander N. Kabaev) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 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