tests: api: allow both case of pathsep

This commit is contained in:
Yury Popov
2022-12-26 00:53:58 +03:00
committed by Alexander Epaneshnikov
parent f60f1590db
commit ccc00f9278
+5 -2
View File
@@ -630,8 +630,11 @@ main(int argc, char **argv)
(void)argc; // unused parameter
char *progdir = strdup(argv[0]);
char *dir = strrchr(progdir, PATHSEP);
if (dir != NULL) *dir = 0;
// Path separator on windows may be both '/' and '\'
char *dir;
if ((dir = strrchr(progdir, PATHSEP)) != NULL) *dir = 0;
else if ((dir = strrchr(progdir, '/')) != NULL) *dir = 0;
test_espeak_terminate_without_initialize();
test_espeak_initialize();