lib/getprogname.c


Log

Author Commit Date CI Message
John David Anglin 3c722722 2016-10-26T17:16:01 getprogname: port to HP-UX See Bug#24805. * lib/getprogname.c (getprogname) [__hpux]: Port. * tests/test-getprogname.c (STREQ) [__hpux]: Special-case for HP-UX limitations on program name length.
Bruno Haible 7082adff 2016-10-16T13:53:18 getprogname: Fix test failure on Cygwin. Comments. * lib/getprogname.h: Add comments. * lib/getprogname.c: Add comments. Fix #elif indentation. * tests/test-getprogname.c (main): On Cygwin, expect a result without ".exe" suffix.
Jim Meyering 7dad5f25 2016-10-13T14:59:10 getprogname: IBM z/OS: avoid NULL-dereference * lib/getprogname.c (getprogname) [__MVS__]: Don't dereference NULL upon strdup failure.
Daniel Richard G d75cbb37 2016-10-13T09:42:42 getprogname: port to IBM z/OS * lib/getprogname.c (getprogname): Use w_getpsent() to get the name.
Jim Meyering 65e69153 2016-10-01T19:53:52 getprogname: correct the test for a __progname variable * m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Use AC_CACHE_CHECK and AC_LINK_IFELSE to check for a global __progname. If found, define HAVE_VAR___PROGNAME. * lib/getprogname.c (getprogname): Reflect the new name of the preprocessor symbol: s/HAVE_DECL___PROGNAME/HAVE_VAR___PROGNAME/ Assaf Gordon reported that the erroneous prior check caused link failure on AIX 7 in https://lists.gnu.org/archive/html/grep-devel/2016-10/msg00001.html
Jim Meyering af62896a 2016-09-28T20:57:24 getprogname: avoid __progname vs program_invocation_short_name pitfall I.e., don't let the OpenBSD 5.1 fix induce failure when using newer glibc. Would have caused failure with Fedora 25's glibc-2.24-3, but not with Fedora 24's glibc-2.23.1-10. * lib/getprogname.c (__progname): Move this declaration down... (getprogname): ... into the #elif block where used, and make it explicitly "extern".
Jim Meyering 9a8bf3b5 2016-09-28T11:09:03 getprogname: port to OpenBSD 5.1 * lib/getprogname.c (__progname) [HAVE_DECL___PROGNAME]: Declare. (getprogname) [HAVE_DECL___PROGNAME]: Return __progname or "?". * modules/getprogname (configure.ac): Move most of this code... * m4/getprogname.m4 (gl_FUNC_GETPROGNAME): ... to this function, increment serial number, and add a test for __progname. https://bugs.gnu.org/24562 Reported by Nelson H. F. Beebe.
Jim Meyering e24a4701 2016-09-21T21:15:59 getprogname: port to AIX * lib/getprogname.c (getprogname) [_AIX]: Use getpid, getprocs64 and strdup to obtain a short program name string. Using code from Bruno Haible and an idea from Bastien ROUCARIÈS, in https://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00249.html Assaf Gordon reported that this new file would fail to compile on AIX-7.1 32bit.
Gisle Vanem f184a68f 2016-09-07T10:45:03 getprogname: fix errors in previous change * lib/getprogname.c (getprogname) [HAVE_GETEXECNAME]: s/program_invocation_name/base/ [HAVE_DECL___ARGV]: Handle NULL __argv or __argv[0].
Jim Meyering 320679aa 2016-09-07T07:57:47 getprogname: port to systems with __argv (mingw, msvc) * lib/getprogname.c (getprogname): Include "dirname.h" and use last_component: more general than open coding it with hard-coded "/". * lib/getprogname.h (getprogname): Prefer "char const *" consistently. * modules/getprogname (Depends-on): Add dirname-lgpl. (configure.ac): Check for __argv in <stdlib.h>. * modules/getprogname-tests: New file. * tests/test-getprogname.c: New file. Suggested by Gisle Vanem in https://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00014.html
Paul Eggert 53270b27 2016-09-06T23:56:26 getprogname: port to Solaris 10 * lib/getprogname.c: Include stdlib.h, for getexecname decl. (getprogname) [HAVE_GETEXECNAME]: Use that, for Solaris 10. * m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Check for getexecname.
Pino Toscano 653a5be9 2016-08-18T15:18:22 getprogname: new module This provides a LGPL module for getting the name of the current program, using the same API found on *BSD systems. * lib/getprogname.c, lib/getprogname.h, m4/getprogname.m4: * modules/getprogname: New files. * MODULES.html.sh (Misc): Add getprogname. * NEWS: Document the deprecation of the 'progname' module.