- (djm) [regress/unittests/test_helper/test_helper.c] Fix for systems that

don't set __progname. Diagnosed by Tom Christensen.
This commit is contained in:
Damien Miller 2014-08-21 15:54:50 +10:00
parent 005a64da0f
commit 4f1ff1ed78
2 changed files with 15 additions and 0 deletions

View File

@ -1,6 +1,8 @@
20140821
- (djm) [Makefile.in] fix reference to libtest_helper.a in sshkey test too.
- (djm) [key.h] Fix ifdefs for no-ECC OpenSSL
- (djm) [regress/unittests/test_helper/test_helper.c] Fix for systems that
don't set __progname. Diagnosed by Tom Christensen.
20140820
- (djm) [configure.ac] Check OpenSSL version is supported at configure time;

View File

@ -117,6 +117,19 @@ main(int argc, char **argv)
{
int ch;
/* Handle systems without __progname */
if (__progname == NULL) {
__progname = strrchr(argv[0], '/');
if (__progname == NULL || __progname[1] == '\0')
__progname = argv[0];
else
__progname++;
if ((__progname = strdup(__progname)) == NULL) {
fprintf(stderr, "strdup failed\n");
exit(1);
}
}
while ((ch = getopt(argc, argv, "vqd:")) != -1) {
switch (ch) {
case 'd':