Tcl 8.5 bug?



I think I'm dealing with a bug in Tcl 8.5 on WinXP: I put the results of a [glob] call in a variable; I do a foreach loop through the results, performing [file rootname] on each filename; and the results of [file rootname] erroneously contain file extensions. However, if I inline the call to [glob] in the call to [foreach], then [file rootname] works as expected. Then again, if I sort the [glob] results inline, it malfunctions again. See below for examples. I experience these results both in the most recent ActiveTcl 8.5 release and in a mingw-compiled Tcl 8.5a3. In Tcl 8.4.9, [file rootname] performs as expected in each of these scenarios.

Is this a bug? If so, is it a known bug? If not known, under what category do I report it?

Thanks,
Aric



% info patchlevel

8.5a3

% parray tcl_platform

tcl_platform(byteOrder) = littleEndian
tcl_platform(machine)   = intel
tcl_platform(os)        = Windows NT
tcl_platform(osVersion) = 5.1
tcl_platform(platform)  = windows
tcl_platform(user)      = Aric
tcl_platform(wordSize)  = 4

% set files [glob d:/temp/p*.*]

d:/temp/padgraph-1.1.zip d:/temp/plusminus.kit d:/temp/psnfss.tar d:/temp/psnfss.zip

% foreach file $files {
> puts [file rootname $file]
> }

d:/temp/padgraph-1.1.zip
d:/temp/plusminus.kit
d:/temp/psnfss.tar
d:/temp/psnfss.zip

% foreach file [glob d:/temp/p*.*] {
> puts [file rootname $file]
> }

d:/temp/padgraph-1.1
d:/temp/plusminus
d:/temp/psnfss
d:/temp/psnfss

% foreach file [lsort -dictionary [glob d:/temp/p*.*]] {
> puts [file rootname $file]
> }

d:/temp/padgraph-1.1.zip
d:/temp/plusminus.kit
d:/temp/psnfss.tar
d:/temp/psnfss.zip
.