diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | regress/unittests/test_helper/test_helper.c | 13 |
2 files changed, 15 insertions, 0 deletions
@@ -1,6 +1,8 @@ | |||
1 | 20140821 | 1 | 20140821 |
2 | - (djm) [Makefile.in] fix reference to libtest_helper.a in sshkey test too. | 2 | - (djm) [Makefile.in] fix reference to libtest_helper.a in sshkey test too. |
3 | - (djm) [key.h] Fix ifdefs for no-ECC OpenSSL | 3 | - (djm) [key.h] Fix ifdefs for no-ECC OpenSSL |
4 | - (djm) [regress/unittests/test_helper/test_helper.c] Fix for systems that | ||
5 | don't set __progname. Diagnosed by Tom Christensen. | ||
4 | 6 | ||
5 | 20140820 | 7 | 20140820 |
6 | - (djm) [configure.ac] Check OpenSSL version is supported at configure time; | 8 | - (djm) [configure.ac] Check OpenSSL version is supported at configure time; |
diff --git a/regress/unittests/test_helper/test_helper.c b/regress/unittests/test_helper/test_helper.c index 6faf99e51..d0bc67833 100644 --- a/regress/unittests/test_helper/test_helper.c +++ b/regress/unittests/test_helper/test_helper.c | |||
@@ -117,6 +117,19 @@ main(int argc, char **argv) | |||
117 | { | 117 | { |
118 | int ch; | 118 | int ch; |
119 | 119 | ||
120 | /* Handle systems without __progname */ | ||
121 | if (__progname == NULL) { | ||
122 | __progname = strrchr(argv[0], '/'); | ||
123 | if (__progname == NULL || __progname[1] == '\0') | ||
124 | __progname = argv[0]; | ||
125 | else | ||
126 | __progname++; | ||
127 | if ((__progname = strdup(__progname)) == NULL) { | ||
128 | fprintf(stderr, "strdup failed\n"); | ||
129 | exit(1); | ||
130 | } | ||
131 | } | ||
132 | |||
120 | while ((ch = getopt(argc, argv, "vqd:")) != -1) { | 133 | while ((ch = getopt(argc, argv, "vqd:")) != -1) { |
121 | switch (ch) { | 134 | switch (ch) { |
122 | case 'd': | 135 | case 'd': |