Skip to content

Commit

Permalink
Windows: Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Dec 10, 2023
1 parent fd86a6f commit bbe816a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/testlo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,12 +1450,13 @@ void test_subtest(lo_server_thread st)

#ifdef WIN32
{
char cwd[2048];
char cwd[MAX_PATH];
// Calculate path to subtest.exe
GetModuleFileName(NULL, cwd, MAX_PATH);
char *lastBackslash = strrchr(cwd, '\\');
const char* pathdelim_str = PATHDELIM;
char *lastBackslash = strrchr(cwd, *pathdelim_str);
*lastBackslash = 0; // Null-terminate at the last backslash to get the directory
snprintf(cmd, 2048, "%s" PATHDELIM "subtest" EXTEXE, cwd);
snprintf(cmd, sizeof(cmd), "%s" PATHDELIM "subtest" EXTEXE, cwd);
}
printf("spawning subtest with `%s'\n", cmd);
for (i=0; i<2; i++) {
Expand Down

0 comments on commit bbe816a

Please sign in to comment.