From: Guillem Jover Date: Mon, 19 Jun 2017 19:32:01 +0000 (+0200) Subject: test: Handle libtool executable names in getprogname() unit test X-Git-Tag: 0.8.5~6 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=736e12e8d868659095ee46d32901e034840f1454;p=thirdparty%2Flibbsd.git 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 --- diff --git a/test/progname.c b/test/progname.c index d6d0a73..811bcdb 100644 --- a/test/progname.c +++ b/test/progname.c @@ -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);