Fix T41962: Command-line without specified filename doesn't renders

Issue was caused by the launcher not dealing with slashes in the way
windows expects them to be handled -- last slash of the path considered
an escape character for the following qoute.

This is definitely to be ported to the 2.72 release.
This commit is contained in:
Sergey Sharybin 2014-09-26 15:07:59 +06:00
parent 8862f68f03
commit 7af5bd0b3a
Notes: blender-bot 2023-02-14 10:02:28 +01:00
Referenced by issue #41962, command-line without specified filename doesn't renders
1 changed files with 6 additions and 1 deletions

View File

@ -58,9 +58,14 @@ int main(int argc, const char **UNUSED(argv_c))
wcsncpy(command, BLENDER_BINARY, len - 1);
len -= wcslen(BLENDER_BINARY);
for (i = 1; i < argc; ++i) {
size_t argument_len = wcslen(argv_16[i]);
wcsncat(command, L" \"", len - 2);
wcsncat(command, argv_16[i], len - 3);
len -= wcslen(argv_16[i]) + 1;
len -= argument_len + 1;
if (argv_16[i][argument_len - 1] == '\\') {
wcsncat(command, L"\\", len - 1);
len--;
}
wcsncat(command, L"\"", len - 1);
}