Tcl Source Code

Check-in [a504c293c3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:3546275 Make [auto_execok] search match [exec]. Thanks Koen Danckaert.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-4-branch
Files: files | file ages | folders
SHA1: a504c293c3ddf03beaf3eabb805d7f863d2f080a
User & Date: dgp 2012-07-25 14:39:29
Context
2012-07-27
21:45
Support Unicode 6.2 (Add Turkish lira sign) check-in: a2a0d1ae92 user: jan.nijtmans tags: core-8-4-branch
2012-07-25
14:44
3546275 Make [auto_execok] search match [exec]. Thanks Koen Danckaert. check-in: 1710c3171d user: dgp tags: core-8-5-branch
14:39
3546275 Make [auto_execok] search match [exec]. Thanks Koen Danckaert. check-in: a504c293c3 user: dgp tags: core-8-4-branch
14:34
:q! Closed-Leaf check-in: 0e346c8fb9 user: dgp tags: mistake
2012-07-24
20:18
Preserve the chanPtr so that script evaluation cannot invalidate it when we plan to use it again. check-in: ea138c4fb3 user: dgp tags: core-8-4-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to library/init.tcl.

614
615
616
617
618
619
620


621
622
623


624
625
626
627
628
629
630
631
632

    foreach var {PATH Path path} {
	if {[info exists env($var)]} {
	    append path ";$env($var)"
	}
    }



    foreach dir [split $path {;}] {
	# Skip already checked directories
	if {[info exists checked($dir)] || $dir eq {}} { continue }


	set checked($dir) {}
	foreach ext $execExtensions {
	    set file [file join $dir ${name}${ext}]
	    if {[file exists $file] && ![file isdirectory $file]} {
		return [set auto_execs($name) [list $file]]
	    }
	}
    }
    return ""







>
>
|
|
|
>
>
|
<







614
615
616
617
618
619
620
621
622
623
624
625
626
627
628

629
630
631
632
633
634
635

    foreach var {PATH Path path} {
	if {[info exists env($var)]} {
	    append path ";$env($var)"
	}
    }

    foreach ext $execExtensions {
	unset -nocomplain checked
	foreach dir [split $path {;}] {
	    # Skip already checked directories
	    if {[info exists checked($dir)] || $dir eq {}} {
		continue
	    }
	    set checked($dir) {}

	    set file [file join $dir ${name}${ext}]
	    if {[file exists $file] && ![file isdirectory $file]} {
		return [set auto_execs($name) [list $file]]
	    }
	}
    }
    return ""