execute_process: Improve invocation of .cmd/.bat with spaces

Extend the fix from commit 74c9d40876 (execute_process: Fix invocation
of .cmd/.bat with spaces, 2025-01-31) to work without relying on
conversion to a "short path", which may not exist.  Instead, extending
the `cmd /c` wrapper to `cmd /c call` seems to support spaces directly.

Suggested-by: Alexandru Croitor <alexandru.croitor@qt.io>
Fixes: #26655
This commit is contained in:
Brad King
2025-02-10 19:40:52 -05:00
parent 7915d60cc7
commit e388ed687a
5 changed files with 16 additions and 41 deletions

View File

@@ -54,8 +54,8 @@ Options:
* .. versionchanged:: 4.0
On Windows platforms, if the command runs a ``.bat`` or ``.cmd`` script,
it is automatically executed through the command interpreter, ``cmd /c``.
However, paths with spaces may fail if a "short path" is not available.
it is automatically executed through the command interpreter with
``cmd /c call ...``.
No intermediate shell is used, so shell operators such as ``>``
are treated as normal arguments.