-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to John Darrington on 3/19/2007 9:58 PM: > The instructions in progname.h say: > > /* Programs using this file should do the following in main(): > set_program_name (argv[0]); > */ > > /* Set program_name, based on argv[0]. */ > extern void set_program_name (const char *argv0);
Not a bug. set_program_name affects error(), in order to print error messages based on what the user passed in as argv[0], and NOT to print the program's official name. And in this instance, you really DO want argv[0], as the user knows what command they invoked, and not necessarily the canonical name of that command. > > > but the GNU coding standards say: > > "The program's name should be a constant string; don't compute it from > argv[0]. The idea is to state the standard or canonical name for the > program, not its file name." That is in relation to what --version output, or anything else that outputs the canonical name of a program, should use. As an example: $ cp /bin/cp mycp $ ./mycp ./mycp: missing file operand Try `./mycp --help' for more information. $ ./mycp --version | head -n1 cp (GNU coreutils) 6.7 - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF/12p84KuGfSFAYARAlpJAJ4sKxskMJVhGbdRKh8dY9nhzCkQ5wCgm6sE 5ZUx4ZWLqrogVEqXE+PkYso= =5Ime -----END PGP SIGNATURE-----