From 6ff79c918b8a3c8f8fb166867c64a94ec53e3d11 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 16 Jan 2024 20:03:52 +0100 Subject: [PATCH] wip #6615 --- src/CommandLine.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/CommandLine.php b/src/CommandLine.php index ef069cf..6e77add 100644 --- a/src/CommandLine.php +++ b/src/CommandLine.php @@ -26,13 +26,21 @@ class CommandLine function __construct($program, $output = null, $error = true) { + $p = $program; + + if (stristr($program, ' ')) { $program = '"' . $program . '"'; } $this->program = $program; $this->commande = null; if (null === $output) { - $this->output = tempnam(sys_get_temp_dir(), 'Cubist'); + $e = Text::multiExplode('/\\', $p); + $prefix = 'Cubist'; + if (count($e)) { + $prefix = array_pop($e); + } + $this->output = tempnam(sys_get_temp_dir(), $prefix ?: 'Cubist'); } else { $this->temp_output = false; $this->output = $output; -- 2.39.5