Hello, 

> +#if HAVE_DECL_PROGRAM_INVOCATION_NAME
> +  program_invocation_name = (char *) argv0;
> +#endif

In my opinion, that's not correct.  Libc (and gnulib's argp, FWIW) uses
two variables: program_invocation_name, which points to the full program
name as obtained from argv[0], and program_invocation_short_name, which
points to the program name with all leading directories removed.  So,
set_program_name should set program_invocation_name to arg0, and
program_invocation_short_name to part of arg0 after the last directory
separator.

Regards,
Sergey


Reply via email to