From b0b44dcfbdf04f8a544df8bfc1fdbc67ec64310e Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 11 Jan 2026 12:28:39 +0100 Subject: [PATCH] Replaced call to 'which', which doesn't exist on Windows (native) platforms. --- VendorScripts_GHDL.tcl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/VendorScripts_GHDL.tcl b/VendorScripts_GHDL.tcl index f6f35f2..ff5c004 100644 --- a/VendorScripts_GHDL.tcl +++ b/VendorScripts_GHDL.tcl @@ -70,7 +70,14 @@ package require fileutil # running on MSYS2 - convert which with cygpath set ghdl [exec cygpath -m [exec which ghdl]] } else { - set ghdl [exec which ghdl] + set delimiter [expr {[string match "*;*" $::env(PATH)] ? ";" : ":"}] + foreach dir [split $::env(PATH) $delimiter] { + set fullPath [file join $dir "ghdl.exe"] + if {[file exists $fullPath] && [file executable $fullPath]} { + set ghdl [file normalize $fullPath] + break + } + } } regexp {GHDL\s+\d+\.\d+\S*} [exec $ghdl --version] VersionString