[glob] + [file tail] gives wrong result
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tcl8.5 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: tcl8.5
This bug is reported upstream as: https:/
In a specific scenario involving [glob] with a trailing slash, the
resulting files are treated improperly by [file tail]. An attached script,
which can be run by
$ tclsh fff.tcl
Expected output:
/bin/ /bin
Actual output:
/bin/ {}
("bin" can be another directory name such as "mnt" or "etc"; it depends on the order of directories returned by [glob]. The important thing is that [file tail] returns an empty string when it should return a non-empty one)
In my application, the only observed consequence of this bug is to display an empty string onscreen where a directory name should be shown, but if the result of [file tail] is used to decide on a file to use for input or output, this bug could change the file actually being opened.
I observed this bug in a Jaunty alpha. I did not test Intrepid. The bug does not exist in Hardy.