Skip to content

Commit

Permalink
Bug [4e2c8bc4a7]. Missing auto_execok cmd builtins
Browse files Browse the repository at this point in the history
  • Loading branch information
apnadkarni committed Jan 26, 2025
1 parent e0d39ce commit fbe7add
Show file tree
Hide file tree
Showing 2 changed files with 17 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 @@ -590,8 +590,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
13 changes: 13 additions & 0 deletions tests/exec.test
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,19 @@ test exec-21.2 {exec encoding mismatch on stderr} -setup {
list [catch {exec [info nameofexecutable] $path(script)} r] $r
} -result [list 1 a\uFFFDb]

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 "auto_execok $cmdBuiltin" \
-result "[file normalize $::env(COMSPEC)] /c $cmdBuiltin"
}
unset cmdBuiltin


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

0 comments on commit fbe7add

Please sign in to comment.