mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-07 17:52:34 +01:00
test: Handle libtool executable names in getprogname() unit test
Sometimes libtool will prefix the test programs with "lt-", we should handle these and strip the prefix. Fixes: https://bugs.debian.org/865090
This commit is contained in:
parent
8bff4b1fab
commit
736e12e8d8
@ -31,7 +31,12 @@
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
assert(strcmp(getprogname(), "progname") == 0);
|
||||
const char *progname;
|
||||
|
||||
progname = getprogname();
|
||||
if (strncmp(progname, "lt-", 3) == 0)
|
||||
progname += 3;
|
||||
assert(strcmp(progname, "progname") == 0);
|
||||
|
||||
setprogname("program-name");
|
||||
assert(strcmp(getprogname(), "program-name") == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user