8000 bug #54006 [Process] Fix the `command -v` exception (kayw-geek) · symfony/symfony@faac38c · GitHub
[go: up one dir, main page]

Skip to content

Commit faac38c

Browse files
bug #54006 [Process] Fix the command -v exception (kayw-geek)
This PR was submitted for the 7.1 branch but it was merged into the 6.4 branch instead. Discussion ---------- [Process] Fix the `command -v` exception | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #53479 | License | MIT This PR is a continuation of the fixes made in PR #53481 to address the issue. The previous PR partially addressed the problem, but after further review and testing, it was determined that additional changes were needed. Fix the `command -v` exception when the command option with a dash prefix. Commits ------- 2b73f0c Fix the `command -v` exception when the command option with a dash prefix
2 parents d352e98 + 2b73f0c commit faac38c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Process/ExecutableFinder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function find(string $name, ?string $default = null, array $extraDirs = [
7272
}
7373
}
7474

75-
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v';
75+
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v --';
7676
if (\function_exists('exec') && ($executablePath = strtok(@exec($command.' '.escapeshellarg($name)), \PHP_EOL)) && @is_executable($executablePath)) {
7777
return $executablePath;
7878
}

0 commit comments

Comments
 (0)
0