Skip to content

Commit

Permalink
Cherrypick fix for [4e2c8bc4a7] - auto_execok missing internal cmd co…
Browse files Browse the repository at this point in the history
…mmands
  • Loading branch information
apnadkarni committed Jan 28, 2025
1 parent 5a9b2f0 commit 8691ab3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/init.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,10 @@ proc auto_execok name {
}
set auto_execs($name) ""

set shellBuiltins [list assoc cls copy date del dir echo erase exit ftype \
md mkdir mklink move rd ren rename rmdir start time type ver vol]
set shellBuiltins [list assoc call cd cls color copy date del dir echo \
erase exit ftype for if md mkdir mklink move path \
pause prompt rd ren rename rmdir set start time \
title type ver vol]
if {[info exists env(PATHEXT)]} {
# Add an initial ; to have the {} extension check first.
set execExtensions [split ";$env(PATHEXT)" ";"]
Expand Down
14 changes: 14 additions & 0 deletions tests/exec.test
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,20 @@ test exec-bug-4f0b5767ac {exec App Execution Alias} -constraints haveWinget -bod
exec winget --info
} -result "Windows Package Manager*" -match glob

foreach cmdBuiltin {
assoc call cd cls color copy date del dir echo
erase exit ftype for if md mkdir mklink move path
pause prompt rd ren rename rmdir set start time
title type ver vol
} {
test auto_execok-$cmdBuiltin-1.0 "auto_execok $cmdBuiltin" \
-constraints win \
-body {
string equal [auto_execok $cmdBuiltin] \
"[file normalize $::env(COMSPEC)] /c $cmdBuiltin"
} -result 1
}
unset cmdBuiltin

# ----------------------------------------------------------------------
# cleanup
Expand Down

0 comments on commit 8691ab3

Please sign in to comment.