Overview
| Artifact ID: | 92d4510eafd665f2ea507f6c0fbf0680bd558e2d |
|---|---|
| Ticket: | 219209ffffffffffffffffffffffffffffffffff
setting env variable array is broken under Windows. |
| User & Date: | nobody on 2000-10-26 05:03:37 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 3661 Bug Version: 8.2 SubmitDate: '1999-11-23' LastModified: '2000-04-26' Severity: SER Status: Assigned Submitter: techsupp ChangedBy: hobbs RelatedBugIDs: 4109 1999 OS: All Windows FixedDate: '2000-10-25' ClosedDate: '1999-11-24' Name: Mo DeJong Comments: I seem to remember a strange problem like this with Tcl 8.0. At the time, the problem was that after an env var was set a variable trace would get fired and the trace would delete an empty env var. ReproducibleScript: Setting an env variable to the empty string actually removes the variable from the env array under Windows. Here is a quick example. % set env(CLASSPATH) value % parray env env(BLASTER) = A220 I5 D1 T4 env(CLASSPATH) = value env(CMDLINE) = WIN ... % set env(CLASSPATH) "" % parray env env(BLASTER) = A220 I5 D1 T4 env(CMDLINE) = WIN ... (no CLASSPATH key) ObservedBehavior: The env var is deleted when set to "". DesiredBehavior: I want to env var to be set properly. This same code works fine under Linux. This is the defined behavior of Windows env variables, but isn't acceptable because the following fails: if {! [info exists env(CLASSPATH)]} { set env(CLASSPATH) "" } set env(CLASSPATH) $env(CLASSPATH);C:\\dir The interim work-around is to do a read trace on the env array for Windows. -- 11/24/1999 hobbs -- What about: -------------------------------------- set tmpClasspath "" if { [info exists env(CLASSPATH)] } { set tmpClasspath $env(CLASSPATH) } set tmpClasspath "$tmpClasspath;C:\\dir" ... set env(CLASSPATH) $tmpClasspath -------------------------------------- This has the additional benefit of avoiding the overhead of working with the env array except when it's absolutely necessary. Removing environment variables when they are set to null is the normal behavior on Windows; I don't know if it is right to change that behavior. -- 04/10/2000 ericm -- 04/26/2000 hobbs - foundin changed to: "obsolete: 8.2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "07. Variables"
- title changed to:
setting env variable array is broken under Windows.
- type changed to: "Bug"