summaryrefslogtreecommitdiff
path: root/regress/unittests
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-08-21 15:54:50 +1000
committerDamien Miller <djm@mindrot.org>2014-08-21 15:54:50 +1000
commit4f1ff1ed782117f5d5204d4e91156ed5da07cbb7 (patch)
tree586f1a12f47b26c81057a4a6a3019c6578ad9c9f /regress/unittests
parent005a64da0f457410045ef0bfa93c863c2450447d (diff)
- (djm) [regress/unittests/test_helper/test_helper.c] Fix for systems that
don't set __progname. Diagnosed by Tom Christensen.
Diffstat (limited to 'regress/unittests')
-rw-r--r--regress/unittests/test_helper/test_helper.c13
1 files changed, 13 insertions, 0 deletions
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':