run: remove residual use of 'which' command

This is a follow-up commit for "Remove dependency from 'which' utility".

Thanks to John Karcher for reporting.

Fixes #4319
This commit is contained in:
Norman Feske 2021-12-15 15:17:38 +01:00
parent e4ee30abf1
commit aaf9e992da

View File

@ -547,9 +547,10 @@ proc have_installed {program} {
# \return absolute path of command if found, or exists if not # \return absolute path of command if found, or exists if not
# #
proc installed_command {command} { proc installed_command {command} {
if { [catch {set path [exec which $command]}] == 0} {
return $path set path [auto_execok $command]
} if {$path != ""} {
return $path }
set dir { /sbin /usr/sbin /usr/local/bin } set dir { /sbin /usr/sbin /usr/local/bin }