Skip to content

Commit

Permalink
Fixed broken output_log path (#50)
Browse files Browse the repository at this point in the history
Being given the option for Doorstop to automatically redirect the output log is neat, and it saves me from running additional code to patch mainData for the redirect.

However, the path used for it is clearly incorrect, and I've noticed that it isn't just an issue for me: #39

After having a quick peek it appears that the wrong path variable is being used for the absolute directory path, resulting in it being trimmed early due to the filename length being short.
  • Loading branch information
diehy authored Apr 17, 2024
1 parent fadccd0 commit e2028bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/windows/entrypoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void redirect_output_log(DoorstopPaths const *paths) {
return;

char_t *cmd = GetCommandLine();
size_t app_dir_len = strlen(paths->doorstop_filename);
size_t app_dir_len = strlen(paths->app_dir);
size_t cmd_len = strlen(cmd);
size_t new_cmd_len = cmd_len + LOG_FILE_CMD_START_LEN + app_dir_len +
LOG_FILE_CMD_END_LEN + LOG_FILE_CMD_EXTRA;
Expand Down Expand Up @@ -207,4 +207,4 @@ BOOL WINAPI DllEntry(HINSTANCE hInstDll, DWORD reasonForDllLoad,
paths_free(paths);

return TRUE;
}
}

0 comments on commit e2028bc

Please sign in to comment.