Bruno Haible <[EMAIL PROTECTED]> writes: > Well, my intention is basically this:
A few comments..... This isn't as compatible as possible with BSD, as BSD setprogname ignores its argument when the true program name is available from the operating system. LibGW32C-0.3 has getexecname (see <http://sourceforge.net/project/shownotes.php?release_id=154242>), so that function is not unique to Solaris. I just looked it up, and on Solaris, getexecname might fail and return NULL, on programs that are linked statically. Surely you meant base_name rather than basename? How about something like this instead? #if !HAVE_GETEXECNAME # define getexecname() NULL #endif #if !HAVE_GETPROGNAME static const char *progname; void setprogname (const char *arg) { progname = arg; } const char * getprogname () { #if HAVE_PROGRAM_INVOCATION_SHORT_NAME /* glibc */ return program_invocation_short_name; #else const char *p = getexecname (); return base_name (p ? p : progname); #endif } #endif _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib