Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7cf47eeb9e688e7810012eb9b864e6a0eef63a3ca8a62d26dfb87a92af41dea3
Ticket: 1b8a893ded5f2a9b0c70a5893c7a2be3429d8033
TCL_PACKAGE_PATH path is (wrongly) braced.
User & Date: jan.nijtmans on 2025-05-09 13:33:13
Changes

  1. icomment:
    Just a simple demo, why using Tcl list syntax in environment variable is a bad idea. It means that the TCLLIBPATH environment variable can be used to make tclsh 100% disfunctional. Example:
    <pre>
    $ export TCLLIBPATH=\{
    
    $ tclsh
    application-specific initialization failed: Can't find a usable init.tcl in the following directories:
        /usr/library /library /tcl8.6.17/library /tcl8.6.17/library
    
    /usr/lib/tcl8.6/init.tcl: unmatched open brace in list
    unmatched open brace in list
        while executing
    "if {$Dir ni $::auto_path} {
                    lappend ::auto_path $Dir
                }"
        ("foreach" body line 2)
        invoked from within
    "foreach Dir [list $::tcl_library [file dirname $::tcl_library]] {
                if {$Dir ni $::auto_path} {
                    lappend ::auto_path $Dir
                }
            }"
        (in namespace eval "::tcl" script line 4)
        invoked from within
    "namespace eval tcl {
        if {![interp issafe]} {
            variable Dir
            foreach Dir [list $::tcl_library [file dirname $::tcl_library]] {
                if {$Dir ni $::..."
        (file "/usr/lib/tcl8.6/init.tcl" line 55)
        invoked from within
    "source /usr/lib/tcl8.6/init.tcl"
        ("uplevel" body line 1)
        invoked from within
    "uplevel #0 [list source $tclfile]"
    /usr/lib/tcl8.6/init.tcl: unmatched open brace in list
    unmatched open brace in list
        while executing
    "if {$Dir ni $::auto_path} {
                    lappend ::auto_path $Dir
                }"
        ("foreach" body line 2)
        invoked from within
    "foreach Dir [list $::tcl_library [file dirname $::tcl_library]] {
                if {$Dir ni $::auto_path} {
                    lappend ::auto_path $Dir
                }
            }"
        (in namespace eval "::tcl" script line 4)
        invoked from within
    "namespace eval tcl {
        if {![interp issafe]} {
            variable Dir
            foreach Dir [list $::tcl_library [file dirname $::tcl_library]] {
                if {$Dir ni $::..."
        (file "/usr/lib/tcl8.6/init.tcl" line 55)
        invoked from within
    "source /usr/lib/tcl8.6/init.tcl"
        ("uplevel" body line 1)
        invoked from within
    "uplevel #0 [list source $tclfile]"
    /lib/tcl8.6/init.tcl: unmatched open brace in list
    unmatched open brace in list
        while executing
    "if {$Dir ni $::auto_path} {
                    lappend ::auto_path $Dir
                }"
        ("foreach" body line 2)
        invoked from within
    "foreach Dir [list $::tcl_library [file dirname $::tcl_library]] {
                if {$Dir ni $::auto_path} {
                    lappend ::auto_path $Dir
                }
            }"
        (in namespace eval "::tcl" script line 4)
        invoked from within
    "namespace eval tcl {
        if {![interp issafe]} {
            variable Dir
            foreach Dir [list $::tcl_library [file dirname $::tcl_library]] {
                if {$Dir ni $::..."
        (file "/lib/tcl8.6/init.tcl" line 55)
        invoked from within
    "source /lib/tcl8.6/init.tcl"
        ("uplevel" body line 1)
        invoked from within
    "uplevel #0 [list source $tclfile]"
    
    
    This probably means that Tcl wasn't installed properly.
    %
    </pre>
    
  2. login: "jan.nijtmans"
  3. mimetype: "text/x-fossil-wiki"