From 8ab731006e8fca930176a568472628513f9d6bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 19 Feb 2023 21:06:43 +0100 Subject: [PATCH] honor cmd quotes on Windows in run-tests.php --- run-tests.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/run-tests.php b/run-tests.php index 8e6f7f519fb9d..805e2ccaa5603 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1260,6 +1260,13 @@ function system_with_timeout( ) { global $valgrind; + // when proc_open cmd is passed as a string (without bypass_shell=true option) the cmd goes thru shell + // and on Windows quotes are discarded, this is a fix to honor the quotes and allow values containing + // spaces like '"C:\Program Files\PHP\php.exe"' to be passed as 1 argument correctly + if (IS_WINDOWS) { + $commandline = 'start "" /b /wait ' . $commandline; + } + $data = ''; $bin_env = [];