Skip to content

Commit

Permalink
Fix Windows. Thanks to tresf
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Dec 10, 2023
1 parent 9fd8740 commit fd86a6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/testlo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,10 @@ void test_subtest(lo_server_thread st)
#ifdef WIN32
{
char cwd[2048];
_getcwd(cwd, 2048);
// Calculate path to subtest.exe
GetModuleFileName(NULL, cwd, MAX_PATH);
char *lastBackslash = strrchr(cwd, '\\');
*lastBackslash = 0; // Null-terminate at the last backslash to get the directory
snprintf(cmd, 2048, "%s" PATHDELIM "subtest" EXTEXE, cwd);
}
printf("spawning subtest with `%s'\n", cmd);
Expand Down

0 comments on commit fd86a6f

Please sign in to comment.