1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

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
This commit is contained in:
Jim Meyering
2016-09-07 07:57:47 -07:00
parent 4c32543a4f
commit 320679aaa1
6 changed files with 74 additions and 20 deletions

13
modules/getprogname-tests Normal file
View File

@@ -0,0 +1,13 @@
Files:
tests/test-getprogname.c
Depends-on:
assert-h
string
configure.ac:
Makefile.am:
TESTS += test-getprogname
check_PROGRAMS += test-getprogname
test_getprogname_LDADD = $(LDADD)