]> git.ipfire.org Git - thirdparty/git.git/commit - t/t0061-run-command.sh
mingw: support spawning programs containing spaces in their names
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 16 Jul 2019 14:03:12 +0000 (07:03 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Jul 2019 19:47:37 +0000 (12:47 -0700)
commiteb7c78631445f35737d059bea23174d972cf7ca3
tree718db47d93ad8eecfe49c7d055dde4a85f779b2f
parentb697d92f56511e804b8ba20ccbe7bdc85dc66810
mingw: support spawning programs containing spaces in their names

On some older Windows versions (e.g. Windows 7), the CreateProcessW()
function does not really support spaces in its first argument,
lpApplicationName. But it supports passing NULL as lpApplicationName,
which makes it figure out the application from the (possibly quoted)
first argument of lpCommandLine.

Let's use that trick (if we are certain that the first argument matches
the executable's path) to support launching programs whose path contains
spaces.

We will abuse the test-fake-ssh.exe helper to verify that this works and
does not regress.

This fixes https://github.com/git-for-windows/git/issues/692

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c
t/t0061-run-command.sh