Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d0dc2752188902ee8a6ea02f13c1f8a5cbb9fa71
Ticket: 1914604fffffffffffffffffffffffffffffffff
tm.tcl TCLX.y_TM_PATH not portable
User & Date: juliannoble on 2008-03-14 22:50:25
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Apache allows only letters numbers and the underscore in the names of environment variables.
    
    (see http://httpd.apache.org/docs/2.2/env.html)
    
    This means TCL8.5_TM_PATH is converted to TCL8_5_TM_PATH in an apache cgi situation for example, and so tcl::tm::list isn't adjusted accordingly.
    
    The Apache docs claim this is for 'portability reasons' so perhaps it crops up elsewhere.
    
    I got around the issue by adjusting tcl::tm::Defaults in lib/tcl8.5/tm.tcl to check for TCLX_y_TM_PATH if TCLX.h_TM_PATH doesn't exist. 
    
    
    proc ::tcl::tm::Defaults {} {
        global env tcl_platform
    
        lassign [split [info tclversion] .] major minor
        set exe [file normalize [info nameofexecutable]]
    
        # Note that we're using [::list], not [list] because [list] means
        # something other than [::list] in this namespace.
        roots [::list \
        [file dirname [info library]] \
        [file join [file dirname [file dirname $exe]] lib] \
        ]
    
        if {$tcl_platform(platform) eq "windows"} {
    set sep ";"
        } else {
    set sep ":"
        }
        for {set n $minor} {$n >= 0} {incr n -1} {
    set ev TCL${major}.${n}_TM_PATH
    if {[info exists env($ev)]} {
        foreach p [split $env($ev) $sep] {
    path add $p
        }
    } else {
    set ev TCL${major}_${n}_TM_PATH
    if {[info exists env($ev)]} {
        foreach p [split $env($ev) $sep] {
    path add $p
        }
    }
    }
        }
        return
    }
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "juliannoble"
  10. subsystem changed to: "08. Environment Variables"
  11. title changed to: "tm.tcl TCLX.h_TM_PATH not portable"
  12. type changed to: "Bug"