diff options
Diffstat (limited to 'regress/unittests')
-rw-r--r-- | regress/unittests/test_helper/test_helper.c | 13 |
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': |