Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120811192837.GJ27715@brightrain.aerifal.cx>
Date: Sat, 11 Aug 2012 15:28:37 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: Priorities for next release?

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.