summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9a66d74)
Don't assume tincd.exe is in the working directory, especially now that
chdir() is called very early. We use GetModuleFileName() instead.
- if(!strchr(program_name, '\\')) {
- GetCurrentDirectory(sizeof command - 1, command + 1);
- strncat(command, "\\", sizeof command - strlen(command));
- }
-
- strncat(command, program_name, sizeof command - strlen(command));
+ HMODULE module = GetModuleHandle(NULL);
+ GetModuleFileName(module, command + 1, sizeof command - 1);
+ command[sizeof command - 1] = 0;
strncat(command, "\"", sizeof command - strlen(command));
strncat(command, "\"", sizeof command - strlen(command));