From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1532 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Priorities for next release? Date: Sat, 11 Aug 2012 15:28:37 -0400 Message-ID: <20120811192837.GJ27715@brightrain.aerifal.cx> References: <20120811122712.GG27715@brightrain.aerifal.cx> <20120811160950.GH27715@brightrain.aerifal.cx> <20120811165049.GI27715@brightrain.aerifal.cx> <20120812015536.3caa3999@sibserver.ru> <20120812024716.47125694@sibserver.ru> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1344713275 22005 80.91.229.3 (11 Aug 2012 19:27:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Aug 2012 19:27:55 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1533-gllmg-musl=m.gmane.org@lists.openwall.com Sat Aug 11 21:27:55 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1T0HLh-00017b-Qu for gllmg-musl@plane.gmane.org; Sat, 11 Aug 2012 21:27:50 +0200 Original-Received: (qmail 1416 invoked by uid 550); 11 Aug 2012 19:27:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1406 invoked from network); 11 Aug 2012 19:27:48 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1532 Archived-At: On Sat, Aug 11, 2012 at 09:05:41PM +0200, Daniel Cegiełka wrote: > >> what you think? It works for me... so why basename(argv[0])? > >> > >> Daniel > > > > basename() is for stripping path objects, for example, when you run > > prog via full path, /bin/true, basename("/bin/true") = "true" > > > > See man 3 basename > > Indeed, it is better. However, if you run from $PATH, it works ok > without basename(). I was just trying to duplicate existing behavior, which is for __progname to be the basename-only part. By the way, if patching the program to have its own global var, it must not be named __progname but progname or something else. __progname (beginning with 2 underscores) is in the namespace reserved for the implementation and it's a bug for an application to define names in this space. Rich