Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Aug 22, 2024
1 parent 1658179 commit 7dc9d37
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion recipe/win_forwarder.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ int _tmain( int argc, TCHAR *argv[] )
char forwarded[32767];
// the first element is the name of the calling function, which we extend
strcat(forwarded, argv[0]);
strcat(forwarded, "-{{ majorversion }}");
// chop off ".exe" (if the binary we're in was invoked like that)
unsigned int len = strlen(argv[0]);
if (len > 4 && strcmp(&forwarded[len-4], ".exe") == 0)
// set nul-terminator to finish the string early
forwarded[len-4] = '\0';
strcat(forwarded, "-{{ majorversion }}.exe");
// rest stays the same
for (int i = 1; i < argc; i++) {
strcat(forwarded, " ");
Expand Down

0 comments on commit 7dc9d37

Please sign in to comment.